Cannot install mysql2 gem
I finally solved it:
- Downloaded and installed MySQL 64bit version 5.5
- Downloaded the zip archive for the 32bit version 5.5.
- Extracted the 32-bit include and lib folders to
C:\MySQL
. - Installed Ruby 1.9.2.
- Installed the Ruby Devkit.
- Installed the gems:
gem install mysql
gem install mysql2 -- --with-mysql-lib=C:\MySQL\lib --with-mysql-include=C:\MySQL\include
gem install rails
gem install fastthread
gem install haml
It's working as a charm now. It seems the MySQL gem has issues finding the data when dealing with 64-bit.
Here's what worked for me using: Win7 64/MySQL 5.5 64-bit/Ruby 1.9.2:
- Download libmysql.dll.
- Copy the above libmysql.dll to
C:\Ruby192\bin
ANDC:\Ruby192\lib
, or wherever your lib and bin are. - Run:
gem install mysql2 -- '--with-mysql-lib="c:\Program Files\MySQL\MySQL Server 5.5\lib" --with-mysql-include="c:\Program Files\MySQL\MySQL Server 5.5\include" --with-mysql-dir="c:\Program Files\MySQL\MySQL Server 5.5"'
Good luck.
If still getting error then cross check the steps of installation on -
http://rorguide.blogspot.com/2011/03/installing-mysql2-gem-on-ruby-192-and.html
where most of the user were able to install mysql2 gem after following the described steps.