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
- Download a zip file with mysql server 5.1 NOT the msi one. Make sure it's 32-bit NOT 64-bit. (From here)
- Since there is no installer file with this, create a folder c:\mysql-gem-install - you can remove it once you finish.
- Extract all the files from the zip file into the folder you just created.
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.
精彩评论