开发者

installing mysql as a gem

i want to develop rails 3 apps using mysql on windows 7 (64 bit) and i have installed mysql via the 开发者_开发技巧msi download from the mysql site.

my question is that do i still need to install the mysql gem?

thanks


The mysql gem provides the ruby bindings, so yes, you need to install this.

With Rails 3 you should use the mysql2 gem rather than the mysql gem.


Here is a proper solution for anyone interested, that doesn't mess up your current installation of mysql server

  1. Download a zip file with mysql server 5.1 NOT the msi one. Make sure it's 32-bit NOT 64-bit. (From here)
  2. Since there is no installer file with this, create a folder c:\mysql-gem-install - you can remove it once you finish.
  3. Extract all the files from the zip file into the folder you just created.
  4. now run this command

    gem install mysql2 -- '--with-mysql-lib="c:\mysql-gem-install\lib\opt" --with-mysql-include="c:\mysql-gem-install\include"'

I just installed mysql2 gem v. 0.3.7


Yes you do. The mysql gem is a ruby driver (interface) to connect to the mysql database.

You should use mysql2 gem instead with Rails3.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜