欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Rails3.1在windows连接Mysql的问题

程序员文章站 2022-07-14 21:23:00
...
When run rails server,get the error(already install newest RailsInstaller of windows xp and mysql2-0.3.11-x86-mingw32) :
d:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/l
ib/mysql2/mysql2.rb:2:in `require': Incorrect MySQL client library version! This
 gem was compiled for 6.0.0 but the client library is 5.0.16. (RuntimeError)
......

There is a easy way to let RailsInstaller(Ruby1.9.2)  use mysql-connector-c-6.
(1)download mysql-connector-c-noinstall-6.0.2-win32.zip
(2)Unzip the mysql-connector-c-noinstall-6.0.2-win32.zip and copu mysql-connector-c-noinstall-6.0.2-win32\lib\libmysql.dll to RailsInstaller\Ruby1.9.2\bin
Then run rails server,every thing is ok.