Install MySQL gem for half a day before installation.
A small record:
First of all, this article is useful.Article:
Http://geryit.com/blog/2011/01/installing-mysql-with-rails-on-mac-os-x-snow-leopard/
My own environment is
Mac OS X 10.6
$ Rvm -- version
Rvm 1.6.5 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]
$ Mysql -- version
MySQL ver 14.14 distrib 5.1.57, for apple-darwin10.3.0 (i386) using Readline 5.1
$ Ruby-version
Ruby 1.9.2p180 (Revision 30909) [x86_64-darwin10.7.3]
$ Rails-V
Rails 3.0.7
$ Gem -- version
1.6.2
$ Uname-
Darwin bogon 10.7.3 Darwin kernel version 10.7.3: Sun Mar 6 13:37:56 PST 2011; root: xnu-1504.14.2 ~ 1/release_x86_64 x86_64
$ ENV archflags = "-arch x86_64" Gem install -- no-rdoc -- no-ri MySQL -- with-mysql-Config =/usr/local/MySQL/bin/mysql_config
$ ENV archflags = "-arch x86_64" Gem install -- no-rdoc -- no-ri mysql2 -- with-mysql-Config =/usr/local/MySQL/bin/mysql_config
Building native extensions. This cocould take a while...
Successfully installed mysql2-0.3.2
1 gem installed
The main problems we encountered earlier are: compilation is not successful, and gem is installed, but cannot be found in the GEM list.
The solution is mainly to match the gem and Ruby versions, replace the mysql version with 5.1, and install it in the rvm environment instead of using sudo.
Here is just a record, not detailed.
Lixinso [at] Gmail [Dot] com