small medium large xlarge

29 Jan 2009, 06:58
Taro Fukunaga (8 posts)

I’d really like to give MySQL a try too. With an earlier version of the book (and presumably an earlier version of rails) I did not have too much trouble. But now I am struggling. I’ve uninstalled all my gems, uninstalled ruby, and reinstalled everything and started building an app. But I am still seeing problems with the MySQL driver.

Here is how I was able to at least install it:

$ sudo gem install mysql – –with-mysql-config=/usr/local/mysql/bin/mysql_config

But I still can’t migrate:

$ rake db:migrate … !!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql. rake aborted! dlsym(0x155bc50, Init_mysql): symbol not found - /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle

I do have the mysql gem:

$ gem list|grep mysql activerecord-jdbcmysql-adapter (0.9) jdbc-mysql (5.0.4) mysql (2.7)

My environment is Mac OS 10.5.6 and I upgraded to Ruby 1.8.7 and rail 2.2.2. I hope I can get this working, or I may have to revert to sqlite3.

Thanks for any help.

03 Feb 2009, 08:25
Terjin TJ Dhillon (13 posts)

try this sudo gem install mysql – –with-mysql-dir=/usr/local/mysql

23 Feb 2009, 05:24
Taro Fukunaga (8 posts)

Hi Terjin,

It doesn’t work:

~ >sudo gem install mysql –with-mysql-dir=/usr/local/mysql ERROR: While executing gem … (OptionParser::InvalidOption) invalid option: –with-mysql-dir=/usr/local/mysql ~ >

But this did:

~ >sudo gem install mysql – –with-mysql-config Building native extensions. This could take a while… Successfully installed mysql-2.7 1 gem installed ~ >

I haven’t verified that my app can use mysql yet. Thanks for the tip.

You must be logged in to comment