首页 > 数据库技术 > 详细

windows rails new demo时候出错Make sure that `gem install mysql2 -v '0.3.15'` succeeds before bundling.

时间:2014-08-01 19:26:32      阅读:2104      评论:0      收藏:0      [点我收藏+]
rails new demo --database=mysql最后报错
Gem files will remain installed in D:/BillFiles/rails_dev/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.15 for inspection.
Results logged to D:/BillFiles/rails_dev/Ruby193/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9.1/mysql2-0.3.15/gem_make.out
An error occurred while installing mysql2 (0.3.15), and Bundler cannot continue.


Make sure that `gem install mysql2 -v ‘0.3.15‘` succeeds before bundling.


但是执行这句话后还是报错,这说明是驱动出问题
然后看到这篇文章http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/
最后发现自己的ruby193是32位,mysql是64位,这样ruby就连接不上了,所以下载32位的mysql驱动http://dev.mysql.com/downloads/connector/c/
选择32位zip,解压后放在c盘根目录,重命名为
mysql-connector-c-noinstall-6.0.2-win32
gem install mysql2 -- --with-mysql-lib="c:\mysql-connector-c-noinstall-6.0.2-win32\lib"  --with-mysql-include="c:\mysql-connector-c-noinstall-6.0.2-win32\include" --with-mysql-dir="c:\mysql-connector-c-noinstall-6.0.2-win32"

最后把其中lib目录中的
mysql-connector-c-noinstall-6.0.2-win32\lib中的libmysql.dll拷贝到ruby下面的bin目录


终于OK!
 

windows rails new demo时候出错Make sure that `gem install mysql2 -v '0.3.15'` succeeds before bundling.,布布扣,bubuko.com

windows rails new demo时候出错Make sure that `gem install mysql2 -v '0.3.15'` succeeds before bundling.

原文:http://www.cnblogs.com/juandx/p/3885495.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!