简体   繁体   English

Rails过时的宝石

[英]Rails Outdated Gems

Ok so I was adding some tests to a app using the shoulda gem and was getting an error 好的,所以我正在使用Shoulda gem向应用程序添加一些测试,但出现错误

undefined method `allow_value'

Looking at the gem I could see this allow_value method was in a later date of the gem so time to update. 看着gem,我可以看到allow_value方法是在gem的较晚版本中进行的,因此有时间进行更新了。

I ran a global bundle update and so far so good. 我运行了全局捆绑更新,到目前为止一切顺利。 But running the test again same error. 但是再次运行测试会出现同样的错误。

So I bundle outdated and got the following: 所以我捆绑了过时的东西,并得到了以下信息:

Outdated gems included in the bundle:
  * actionmailer (3.2.13 > 3.2.12)
  * actionpack (3.2.13 > 3.2.12)
  * activemodel (3.2.13 > 3.2.12)
  * activerecord (3.2.13 > 3.2.12)
  * activeresource (3.2.13 > 3.2.12)
  * activesupport (3.2.13 > 3.2.12)
  * arel (4.0.0 > 3.0.2)
  * bourne (1.4.0 > 1.1.2)
  * builder (3.2.2 > 3.0.4)
  * coffee-rails (4.0.0 > 3.2.2)
  * faye-websocket (0.6.1 > 0.4.7)
  * json (1.8.0 > 1.7.7)
  * mail (2.5.4 > 2.4.4)
  * mocha (0.14.0 > 0.10.5)
  * rack (1.5.2 > 1.4.5)
  * rails (3.2.13 > 3.2.12)
  * railties (3.2.13 > 3.2.12)
  * rdoc (4.0.1 > 3.12.2)
  * shoulda-matchers (2.1.0 > 1.4.2)
  * sprockets (2.10.0 > 2.2.2)
  * tzinfo (1.0.0 > 0.3.37)

I tried again with bundle update shoulda-matchers but same issue. 我再次尝试使用捆绑包更新shoulda-matchers,但问题相同。

How do I update the gem to the latest version? 如何将gem更新到最新版本? and to that fact how come actionmailer etc is not updated when I run bundle update. 事实是,当我运行捆绑包更新时,怎么不更新actionmailer等。

Hope you can advise. 希望你能指教。

You are still on 3.2.12. 您仍然在3.2.12。
So bundle update doesn't update your Rails version. 因此, bundle update不会更新您的Rails版本。

Make sure your Gemfile has 确保您的Gemfile具有

gem 'rail', '3.2.13'

and run bundle update again. 然后再次运行bundle update

Some gems will still be outdated, because they are already stable for Rails 4 (ie coffee-rails ). 一些宝石仍然会过时,因为它们已经对Rails 4稳定了(例如, coffee-rails )。 You can ignore these 'outdates' 您可以忽略这些“过时”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM