Rails已弃用警告

时间:2011-01-16 15:24:20

标签: ruby-on-rails ruby

我一直试图摆脱这些已弃用的警告2周,但没有运气。如果有人能指出我正确的方向,真的很感激。

第一次警告

WARNING: using the built-in Timeout class which is known to have issues when used for         opening connections. Install the SystemTimer gem if you want to make sure the Redis client will not hang.

第二次警告

/Users/ChuckJHardy/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.7/lib/bundler/shared_helpers.rb:101:Warning: Gem::LoadError#version_requirement= is deprecated and will be removed on or after January 2011. Use #requirement.

第三次警告

/Users/ChuckJHardy/Code/Sites/www/vendor/rails/railties/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010.  Use #requirement

3 个答案:

答案 0 :(得分:3)

第一个错误来自REDIS。从quick googling判断,当Redis尝试加载gem system_timer时,它就会出现。尝试将其添加到您的宝石中,看看它是否已解决。

rails 2.3.5和ruby企业版中的第二个和第三个错误似乎是this problem。有关lighthouse ticket的更多信息,包括一些修复。

答案 1 :(得分:2)

对于第一个,只需按照说明安装SystemTimer gem。

rvmsudo gem install systemtimer

接下来的两个,升级rubygems。

rvmsudo gem update --system

答案 2 :(得分:0)

好的,一个横向解决方案。将其放在您的Environments或Initializers文件中。

ActiveSupport::Deprecation.silenced = true