Mac OS X and Uninitialzed Constant Mysql


#1

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.


#2

“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 ?


#3

Try adding this to the top of your rb file:

require ‘mysql’

On 5/14/06, Mick S. removed_email_address@domain.invalid 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
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


#4

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)