Hi, I''m pretty newb at Rails deployement stuff. I''m setting up a Mongrel web server on windows following the tutorial on the official site. My app works except when there''s interaction with MySQL. I get this error : "Uninitialized constant Mysql" Now i''m pretty lost and i''m sure i''m doing something wrong. I''ve tried searching google, ruby and rails mailing list but didn''t find anything. I''d appreciate if you guys could point me to the right direction. Like what steps I have to do to make mysql interact with Mongrel/Ruby. Thanks Guillaume Carbonneau -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20060818/90d6401e/attachment.html
> Hi, > > I''m pretty newb at Rails deployement stuff. > I''m setting up a Mongrel web server on windows following the tutorial on the > official site. > My app works except when there''s interaction with MySQL. I get this error : > > "Uninitialized constant Mysql" > > Now i''m pretty lost and i''m sure i''m doing something wrong. I''ve tried > searching google, ruby and rails mailing list but didn''t find anything. > I''d appreciate if you guys could point me to the right direction. Like what > steps I have to do to make mysql interact with Mongrel/Ruby.Can you use mysql from straight ruby? If you do "gem list" do you see the following: mysql (2.7) MySQL/Ruby provides the same functions for Ruby programs that the MySQL C API provides for C programs. If not, you should... I could be wrong, but I think that message means you don''t have the ruby/mysql part hooked up. "gem install mysql" should get it for you
On Fri, 2006-08-18 at 10:12 -0400, Guillaume Carbonneau wrote:> Hi, > > I''m pretty newb at Rails deployement stuff. > I''m setting up a Mongrel web server on windows following the tutorial > on the official site. > My app works except when there''s interaction with MySQL. I get this > error : > > "Uninitialized constant Mysql" > > Now i''m pretty lost and i''m sure i''m doing something wrong. I''ve tried > searching google, ruby and rails mailing list but didn''t find > anything. > I''d appreciate if you guys could point me to the right direction. Like > what steps I have to do to make mysql interact with Mongrel/Ruby. >Haven''t seen this from people who use win32, so I''m thinking your setup is wrong somehow. Have you tried installing the win32 mysql gem? gem install mysql I believe that''ll intall it but you have to pick win32. If you''ve already done this then maybe remove it and see if you get the error. -- Zed A. Shaw http://www.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.railsmachine.com/ -- Need Mongrel support?
On 8/18/06, Zed Shaw <zedshaw at zedshaw.com> wrote:> > On Fri, 2006-08-18 at 10:12 -0400, Guillaume Carbonneau wrote: > > Hi, > > > > I''m pretty newb at Rails deployement stuff. > > I''m setting up a Mongrel web server on windows following the tutorial > > on the official site. > > My app works except when there''s interaction with MySQL. I get this > > error : > > > > "Uninitialized constant Mysql" > > > > Now i''m pretty lost and i''m sure i''m doing something wrong. I''ve tried > > searching google, ruby and rails mailing list but didn''t find > > anything. > > I''d appreciate if you guys could point me to the right direction. Like > > what steps I have to do to make mysql interact with Mongrel/Ruby. > > > > Haven''t seen this from people who use win32, so I''m thinking your setup is > wrong somehow. > > Have you tried installing the win32 mysql gem? > > gem install mysql > > I believe that''ll intall it but you have to pick win32. If you''ve > already done this then maybe remove it and see if you get the error. > > > -- > Zed A. Shaw > http://www.zedshaw.com/ > http://mongrel.rubyforge.org/ > http://www.railsmachine.com/ -- Need Mongrel support? > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-usersI updated my gems I tried removing / reinstalling the mysql gem and i''m still getting the error. I always pick the mswin32 btw... I noticed a pattern when I start the mongrel server.. 1st request generates this error : uninitialized constant Mysql 2nd and further errors : uninitialized constant ActiveRecord::Mysql Still getting errors. I tried with dead simple apps and it generates the same errors Thanks for your answers so far... Guillaume Carbonneau -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20060818/9e438a9b/attachment.html
On 8/19/06, Guillaume Carbonneau <gusxedge at gmail.com> wrote:> > > > On 8/18/06, Zed Shaw <zedshaw at zedshaw.com> wrote: > > On Fri, 2006-08-18 at 10:12 -0400, Guillaume Carbonneau wrote: > > > Hi, > > > > > > I''m pretty newb at Rails deployement stuff. > > > I''m setting up a Mongrel web server on windows following the tutorial > > > on the official site. > > > My app works except when there''s interaction with MySQL. I get this > > > error : > > > > > > "Uninitialized constant Mysql" > > > > > > Now i''m pretty lost and i''m sure i''m doing something wrong. I''ve tried > > > searching google, ruby and rails mailing list but didn''t find > > > anything. > > > I''d appreciate if you guys could point me to the right direction. Like > > > what steps I have to do to make mysql interact with Mongrel/Ruby. > > > > > > > Haven''t seen this from people who use win32, so I''m thinking your setup is > wrong somehow. > > > > Have you tried installing the win32 mysql gem? > > > > gem install mysql > > > > I believe that''ll intall it but you have to pick win32. If you''ve > > already done this then maybe remove it and see if you get the error. > > > > > > -- > > Zed A. Shaw > > http://www.zedshaw.com/ > > http://mongrel.rubyforge.org/ > > http://www.railsmachine.com/ -- Need Mongrel support? > > > > _______________________________________________ > > Mongrel-users mailing list > > Mongrel-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mongrel-users > > > I updated my gems > I tried removing / reinstalling the mysql gem and i''m still getting the > error. > I always pick the mswin32 btw... > > I noticed a pattern when I start the mongrel server.. > 1st request generates this error : uninitialized constant Mysql > 2nd and further errors : uninitialized constant ActiveRecord::Mysql > Still getting errors. I tried with dead simple apps and it generates the > same errors > > Thanks for your answers so far... > > Guillaume Carbonneau1. in c:\ruby\lib\gems\gems\activerecord-x.x.x\lib\activerecord\connection_adapters\ (or similar) you should have mysql_adapter.rb. try a little test: just create instance of it, even without any configuration: require ''activerecord/adapters/mysql_adapter'' ActiveRecord::ConnectionAdapters::MysqlAdapter.new() to see if it complains about the constant. 2. in c:\ruby\lib\gems\gems\activerecord-x.x.x\lib\activerecord\vendor\ you should have file mysql.rb - the pure rb mysql driver that is used if the binary one is not used. 3. change your ruby association temporarily to "c:\ruby\bin\ruby.exe" -dw "%1" %* to see all the exceptions and warnings. J.