使用64位ruby和64位窗口在rails上安装ruby的mysql2扩展

时间:2014-06-30 14:29:38

标签: mysql ruby-on-rails ruby windows 64-bit

我已经从http://rubyinstaller.org/downloads/

安装了64位版本的ruby

尝试安装mysql,我下载了64位版本的连接器

我收到错误

compiling client.c
In file included from client.c:1:0:
./mysql2_ext.h:17:19: fatal error: mysql.h: No such file or directory
compilation terminated.
make: *** [client.o] Error 1
正如您在下一个屏幕中看到的那样

enter image description here

1 个答案:

答案 0 :(得分:1)

最后this faq工作了。我猜是因为我在文章中下载了exactly the version of the connector linked并运行了

gem install mysql2 --no-ri --no-rdoc --platform=ruby -- --with-mysql-include=C:/mysql-connector-c-noinstall-6.0.2-winx64\include --with-mysql-lib=C:/mysql-connector-c-noinstall-6.0.2-winx64\lib

编辑 - 使用64位版本连接器的正确版本为found here。正常版本是段错误,所以感谢这个帖子,我找到了正确的版本https://github.com/brianmario/mysql2/issues/372