rails3中默认的mysql适配器是mysql2,执行以下命令进行安装:
?
gem install mysql2
?
结果报出以下错误信息:
?
ERROR:? Error installing mysql2:
??????? The 'mysql2' native gem requires installed build tools.
?
Please update your PATH to include build tools or download the DevK
from 'http://rubyinstaller.org/downloads' and follow the instructio
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
?
最终,通过以下命令成功安装:
?
gem install mysql2 -v 0.2.6 --platform x86-mingw32
?
注意:如果rails版本<3.1.0,就安装mysql 0.2.6,如果rails版本是3.1.*,才需要安装mysql 0.3.*。