gem mysql2没有安装在rails上的ruby上

时间:2014-01-24 08:39:55

标签: mysql ruby-on-rails c ruby mysql2

我安装了以下版本:

  • ruby​​ 1.9.3p484(2013-11-22)[i386-mingw32]
  • rails 4.0.2
  • 的devkit-TDM-32-4.5.2-20111229-1559-SFX
  • 的rubygems-2.1.11
  • MySQL Server 5.6
  • MySQL的连接器-C-noinstall-6.0.2-Win32的VS2005

我运行了以下三个命令:

$ gem i mysql2

$ gem install mysql2 -- '--with-mysql-lib="C:\Program Files\MySQL\MySQL Server 5.6\lib" --with-mysql-include="C:\Program Files\MySQL\MySQL Server 5.6\include" --with-mysql-dir="C:\Program Files\MySQL\MySQL Server 5.6"'

$ gem install mysql2 --platform=ruby -- '--with-mysql-lib="C:\mysql-connector-c-noinstall-6.0.2-win32-vs2005\lib" --with-mysql-include="C:\mysql-connector-c-noinstall-6.0.2-win32-vs2005\include" --with-mysql-dir="C:\mysql-connector-c-noinstall-6.0.2-win32-vs2005"'

以上三厘米有以下错误:

* extconf.rb failed * Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

1 个答案:

答案 0 :(得分:0)

sudo apt-get install libmysql-ruby libmysqlclient-dev

看看这个问题https://stackoverflow.com/a/3608756/1970061