Cannot get mysql gem to work in Snow Leopard, unable to setup ruby on rails environment
I am having some serious problems, however this seems to be a common thing. I have Snow Leopard 10.6.3 and here are my other version info: MySQL mysql Ver 14.14 Distrib 5.1.46, for apple-darwin10.2.0 (i386) using readline 5.1 gem 1.3.6 ruby 1.8.7 (2009-06-08 patchlevel 173) [universal-darwin10.0]
My problem is that no matter what I do to try and install the mysql gem, i still get the error every time i do rake db:migrate
uninitialized constant MysqlCompat::MysqlRes
I have installed the 开发者_JAVA技巧mysql gem based on instructions around the web that say to use
export ARCHFLAGS="-arch i386 -arch x86_64" ; sudo gem install --no-rdoc --no-ri mysql -- -v 2.7 --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/mysql/bin/mysql_config
This DOES work, as it gives this output:
Building native extensions. This could take a while... Successfully installed mysql-2.8.1 1 gem installed
Any help would be greatly appreciated
These instructions worked great for me on Mac OS X Snow Leopard: http://hivelogic.com/articles/compiling-mysql-on-snow-leopard
if you've migrated to snow leopard from leopard, you may need to rebuild ruby. I was having the same problem that I solved by recompiling ruby from source.
Also, mysql gem 2.8 is (was?) incompatible with snow leopard, so you may try 2.7. There was an explanation of 2.8 issues somewhere on SO.
精彩评论