How to use “mysql2” gem in Rails 3 application on Windows 7?

前端 未结 6 1068
北恋
北恋 2020-12-28 10:35

I try to install the mysql2 gem on Windows 7 32-bit.

I run:

gem install mysql2

and I get the following error:

6条回答
  •  旧巷少年郎
    2020-12-28 11:28

    THANK YOU! One note: I had to include the --platform=ruby option as well. Thus, the final entire command line was:

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

    When I tried it without the platform=ruby option, DevKit didn't run and it just installed the normal mysql2 gem - it even gave a warning message about mysql2 being built for 6.0.2. I uninstalled it (gem uninstall mysql2), then ran it again with --platform=ruby and it worked awesome!

    Me: Windows 7 64bit, Ruby 1.9.3p125, Rails 3.2.1, MySQL 5.1.56

提交回复
热议问题