I\'m unable to install the mysql2 gem in my Windows7 x64 system. I tried using both the 32-bit and 64-bit versions of MySQL server but none got me any further.
I ins
this is what worked for me on windows 8 64bit and using ruby 64bit
download and install MYSQL Server 5.6 64bit
then run the command:
gem install mysql2 -v '0.3.16' -- '--with-mysql-lib="c:\Program Files\MySQL\MySQL Server 5.6\lib" --with-mysql-include="c:\Program Files\MySQL\MySQL Server 5.6\include"'
hope this helps
The accepted answer did not work for me, and neither did the the other 2. However, a comment by MG on the link from Ritesh did the trick for me. I had to specify version 0.2.6, and include the parameter --platform=ruby. (Note: I also had to download the "noinstall" version of MySQL to get the /lib/opt)
Here is how I got the gem installed on Windows
gem install mysql2 -v 0.2.6 -- --platform=ruby --with-mysql-lib=C:\Ruby192\MySQL\lib\opt --with-mysql-dir=C:\Ruby192\MySQL
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.