Bundler不会安装mysql2 [英] Bundler won't install mysql2

查看:107
本文介绍了Bundler不会安装mysql2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我已经在SO和Google上发布了数十篇文章,并且一直未能找到答案。
我试图用bundler安装mysql2,它不会这样做。



Ubuntu Server 11.04 Natty上运行



以下是一些背景信息:

  ruby​​ -v 
ruby 1.8.7(2012-02-08 patchlevel 358)[x86_64-linux]

gem -v
1.8.24

rails -v
Rails 3.2.5

$ mysql --version
mysql Ver 14.14 Distrib 5.1.62,用于使用readline的debian-linux-gnu(x86_64)6.2

我在gemfile中有gemmysql2,〜> 0.3.11

当我执行捆绑安装时,它会经历整个过程并成功完成(无错误),但它不会安装mysql2。当我做 bundle show 时,mysql2没有列出。



我试过了很多这里和论坛推荐的东西, t得到mysql2与捆绑软件安装。



任何想法?



谢谢。

解决方案

拉我的头发我发现了什么问题,所以我张贴它可能会遇到同样的情况。



bundler之所以不会安装mysql2是因为gem是在这个 platforms 结构中的,见下:

  platforms:mri_19, :mingw_19 do 
group:mysql do
gemmysql2,0.3.11
end
end

因此,我所做的只是将gemmysql2,0.3.11自身移动到Gemfile的顶部,然后运行 bundle install 而且做到了!现在,mysql2列在bundle show下,我的rails应用程序正在运行。



感谢每一位试图提供帮助的人!


First of all I've gone through dozens of posting here on SO and google and haven't been able to find an answer. I'm trying to install mysql2 with bundler and it won't do it.

Running on Ubuntu Server 11.04 Natty

Here's some background info:

ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]

gem -v
1.8.24

rails -v
Rails 3.2.5

$ mysql --version
mysql  Ver 14.14 Distrib 5.1.62, for debian-linux-gnu (x86_64) using readline 6.2

I have gem "mysql2", "~> 0.3.11" in my Gemfile

When I do bundle install it goes through the process and it finishes successfully (No Errors) but it doesn't install mysql2. When I do bundle show, mysql2 is not listed.

I've tried a gazillion of things recommended here and on forums and still can't get mysql2 to install with bundler.

Any ideas?

Thanks.

解决方案

So after many tries, reading, and pulling my hair out I found out what was the problem, so I'm posting it for those that might run into the same situation.

The reason why bundler wouldn't install mysql2 is because the gem was inside this platforms structure, see below:

platforms :mri_19, :mingw_19 do
  group :mysql do
    gem "mysql2", "0.3.11"
  end
end

So all I did was to move just gem "mysql2", "0.3.11" by itself to the top of the Gemfile and run bundle install and that did it! Now mysql2 is listed under bundle show and my rails application is running now.

Thanks every one that tried to help!

这篇关于Bundler不会安装mysql2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆