简体   繁体   中英

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

这些说明对我在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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM