Development Platform: ruby 1.8.4 Rails 1.1.2 mysql "gem" 2.7 Mac OS X (10.4.6), 64-bit Mysql 5.0.19-standard (64-bit) Lighttpd, 1.4.11 I''m trying to startup a simple test rails app against mysql. Rails starts up fine and my pages render successfully, until a DB access is made. I''m getting a "uninitialized constant Mysql". I''ve searched, but can''t find an answer. Thanks.
"uninitialized constant xxx" errors usually indicate that Ruby cannot find a definition for class xxx. Have you configured your databases correctly in config/database.yml ? -- Posted via http://www.ruby-forum.com/.
Try adding this to the top of your rb file: require ''mysql'' On 5/14/06, Mick Sharpe <mick.sharpe@btinternet.com> wrote:> "uninitialized constant xxx" errors usually indicate that Ruby cannot > find a definition for class xxx. Have you configured your databases > correctly in config/database.yml ? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >On 5/14/06, Jeremy Torres <jeremy.torres@gmail.com> wrote:> Development Platform: > ruby 1.8.4 > Rails 1.1.2 > mysql "gem" 2.7 > Mac OS X (10.4.6), 64-bit > Mysql 5.0.19-standard (64-bit) > Lighttpd, 1.4.11 > > I''m trying to startup a simple test rails app against mysql. Rails > starts up fine and my pages render successfully, until a DB access is > made. I''m getting a "uninitialized constant Mysql". I''ve searched, > but can''t find an answer. Thanks. > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- http://jameshalberg.com
Sounds like the mysql driver isn''t installed. take a look at /config/database.yml : # On MacOS X: # gem install mysql -- --include=/usr/local/lib I used Todd Huss''s intel binary package for my macbook: http://gabrito.com/post/ruby-on-rails-mac-osx-intel-binary (currently down) On 5/14/06, Jeremy Torres <jeremy.torres@gmail.com> wrote:> Development Platform: > ruby 1.8.4 > Rails 1.1.2 > mysql "gem" 2.7 > Mac OS X (10.4.6), 64-bit > Mysql 5.0.19-standard (64-bit) > Lighttpd, 1.4.11 > > I''m trying to startup a simple test rails app against mysql. Rails > starts up fine and my pages render successfully, until a DB access is > made. I''m getting a "uninitialized constant Mysql". I''ve searched, > but can''t find an answer. Thanks. > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >