could not find gem 'mysql2_mysql2 gem为错误的mysql客户端库编译

我和您有相同的问题,或者至少症状是相同的。

背景:我正在使用Windows计算机本地安装的Rails 3,mysql2 gem和MySQL社区服务器版本5.5.21(32位)。我libmysql.dll从MySQL安装中获取了客户端库(),并将其复制到了ruby安装的bin文件夹中。

当我运行时bundle exec rake db:create,我得到了与您相同的错误消息,并且我想:“嘿,当我从最新的MySQL版本中获得客户端库时,该客户端库怎么过时了?”

当您显示一条有用的消息gem install mysql2。不幸的是,如果您在Bundler上安装宝石,Bundler会收到消息。这里是:

=========================================================================

You've installed the binary version of mysql2. It was built using MySQL

Connector/C version 6.0.2. It's recommended to use the exact same version

to avoid potential issues.

At the time of building this gem, the necessary DLL files where available

in the following download:

http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0.2-win32.zip/from/pick

And put lib\libmysql.dll file in your Ruby bin directory, for example

C:\Ruby\bin

遵循这些说明可以为我解决问题。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值