Mac OS X and Uninitialzed Constant Mysql

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 ?

Try adding this to the top of your rb file:

require ‘mysql’

On 5/14/06, Mick S. [email protected] 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
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

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)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs