gem mysql2未安装在rails上的ruby上[重复]
Posted
技术标签:
【中文标题】gem mysql2未安装在rails上的ruby上[重复]【英文标题】:gem mysql2 not installed on ruby on rails [duplicate] 【发布时间】:2014-02-15 04:07:29 【问题描述】:我安装了以下版本:
ruby 1.9.3p484 (2013-11-22) [i386-mingw32] 导轨 4.0.2 DevKit-tdm-32-4.5.2-20111229-1559-sfx rubygems-2.1.11 mysql 服务器 5.6 mysql-connector-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"'
以上三个cmds有以下错误:
* 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】:sudo apt-get install libmysql-ruby libmysqlclient-dev
看这个问题https://***.com/a/3608756/1970061
【讨论】:
以上是关于gem mysql2未安装在rails上的ruby上[重复]的主要内容,如果未能解决你的问题,请参考以下文章
错误:无法构建 gem 本机扩展(rails 3.2.3 上的 mysql2)
未加载库:尝试使用 mysql2 gem 在 OS X 10.6 上运行“rails server”时出现 libmysqlclient.16.dylib 错误