为什么“捆绑更新”安装古代宝石? [英] Why is 'bundle update' installing ancient gems?

查看:90
本文介绍了为什么“捆绑更新”安装古代宝石?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一切正常,直到出乎意料的是,捆绑更新决定更新某些非常旧的版本的某些宝石。有任何想法吗?我很困惑!



Gemfile没有指定awry gems的版本。例如

  gem'rails'

我做...

 包更新



和(!)...

 使用rails(0.9.5)

如果我指定一个版本。例如

  gem'rails','〜> 3.0'

然后就可以了。

使用rails(3.0.7)

来源'http:/ /rubygems.org'



宝石版本1.8.3,rvm版本1.6.14

只有一些宝石是错误。 mongoid是另一个。它在1.0.6上。谢谢!

解决方案

问题解决了。这是一场宝石冲突。我将它简化为...



只需这两个宝石:

  gem'rails'
gem'i18n'

您将获得i18n 0.6.0 (最新版本),但rails是3.0.5(3.0.7是最新版本)。

然后就是这三个:


  gem'rails'
gem'i18n'
gem'delayed_job'

您得到:

 包含的宝石:
* actionmailer(0.6.1)
* actionpack(1.4.0)
* activerecord(1.6.0)
* activesupport(3.0.7)
* bundler(1.0 (2.1.4)
* delayed_job(2.1.4)
* i18n(0.6.0)
* rails(0.9.5)< - - 嗨!那会带回回忆!
* rake(0.9.0)

我还没有深入了解bundler的gem依赖关系仍然有效,但那是它的原因。有趣!当然,也不需要包括i18n gem,所以删除修复的东西(或指定宝石版本)。


Everything was working just fine until, out of the blue, bundle update decided to 'update' to some very old versions of some gems. Any ideas? I'm baffled!

The Gemfile doesn't specify a version for the awry gems. eg.

gem 'rails'

I do...

bundle update

And(!)...

Using rails (0.9.5)

If I specify a version. eg.

gem 'rails', '~> 3.0'

Then it's ok.

Using rails (3.0.7)

Source 'http://rubygems.org'

Gem version 1.8.3, rvm version 1.6.14

Only some gems are wrong. mongoid is another. It's on 1.0.6. Thanks!

解决方案

Problem solved. It was a gem conflict. I boiled it down to...

With just these two gems:

gem 'rails'
gem 'i18n'

You get i18n 0.6.0 (the latest) but rails is on 3.0.5 (3.0.7 is current latest).

And then with just these three:

gem 'rails'
gem 'i18n'
gem 'delayed_job'

You get:

Gems included by the bundle:
  * actionmailer (0.6.1)
  * actionpack (1.4.0)
  * activerecord (1.6.0)
  * activesupport (3.0.7)
  * bundler (1.0.13)
  * daemons (1.1.3)
  * delayed_job (2.1.4)
  * i18n (0.6.0)
  * rails (0.9.5)  <-- Yikes! that brings back memories!
  * rake (0.9.0)

I've not looked deeper into how bundler's gem dependencies work yet, but that was what caused it. Interesting! And of course there's no need to include the i18n gem anyway, so removing that fixes things (or specifying gem versions).

这篇关于为什么“捆绑更新”安装古代宝石?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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