uninitialized constant MysqlCompat::MysqlRes
I am getting uninitialized constant MysqlCompat::MysqlRes when I run rake db:migrate.
So here is my story. I upgraded my system to snow leopard and I had an existing project, which was running fine. I was trying to upgrade some stuff, one of which was mysql to 64 bit. That is when everything went wrong. So if I do the following I get the following results from my work/myproject directory.
file which mysql /usr/local/mysql开发者_JAVA百科/bin/mysql: Mach-O executable i386 file which ruby /usr/local/bin/ruby: Mach-O executable i386
So I honestly don't know where I stand it this point. I thought I installed the 64bit version of mysql but this doesn't show so.
I ran gem uninstall mysql and then ran sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Did not work either!
Can anyone help?
this worked for me (on OS X 10.6.6):
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/
The problem is that you need to be using the same architecture for ruby, libmysqlclient and the mysql ruby gem (i386 or x86_64).
I notice the ruby you've referenced is in /usr/local/bin/ruby
instead of the system standard location of /usr/bin/ruby
— make sure you are using the version of ruby you intended to.
using i386 instead of x86_64 worked for me
sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
精彩评论