ruby on rails - MySQL Gem failure: MysqlCompat::MysqlRes on Snow Leopard -
i trying mysql gem work ... , doesn't want to. every time rake db:migrate, get
uninitialized constant mysqlcompat::mysqlres
i've installed mysql disk image: mysql-5.5.9-osx10.6-x86_64.dmg
i've run gem install infamous archflags setting:
sudo env archflags="-arch x86_64" gem install --no-rdoc --no-ri mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
and ruby version i'm using default snow leopard:
[~/sites/testdb]$ file `which mysql` /usr/local/mysql/bin/mysql: mach-o 64-bit executable x86_64 [~/sites/testdb]$ file `which ruby` /usr/bin/ruby: mach-o universal binary 3 architectures /usr/bin/ruby (for architecture x86_64): mach-o 64-bit executable x86_64 /usr/bin/ruby (for architecture i386): mach-o executable i386 /usr/bin/ruby (for architecture ppc7400): mach-o executable ppc
my database.yml pretty simple:
development: adapter: mysql host: 127.0.0.1 database: testdb username: root password:
any appreciated.
you can easy fix problem.
if don't use rvm:
sudo install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib /library/ruby/gems/1.8/gems/mysql-2.8.1/lib/mysql_api.bundleruby
if use rvm:
install_name_tool -change libmysqlclient.16.dylib usr/local/mysql/lib/libmysqlclient.16.dylib [your_gemset_path]/gems/mysql-2.8.1/lib/mysql_api.bundle
Comments
Post a Comment