Cannot install mysql2 gem

前端 未结 9 2343
死守一世寂寞
死守一世寂寞 2020-12-05 01:20

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

相关标签:
9条回答
  • 2020-12-05 01:34

    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

    0 讨论(0)
  • 2020-12-05 01:37

    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
    
    0 讨论(0)
  • 2020-12-05 01:41

    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.

    0 讨论(0)
提交回复
热议问题