$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
$ rails -v
Rails 2.3.5
每当我运行script/server
时,我都会收到此警告:
=> Booting Mongrel
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
./script/../config/../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
我该怎么办?
我应该升级Rails还是部分Rails?
或者我还应该做些什么来解决警告?
我不确定“Use#requirement
”是什么意思。我应该在哪里使用它?
我的environment.rb
文件:
require File.join(File.dirname(__FILE__), 'boot')
Rails::Initializer.run do |config|
config.gem('haml', :source => 'http://gemcutter.org')
config.gem('fastercsv', :source => 'http://gemcutter.org')
config.gem('ruby-net-ldap', :lib => 'net/ldap', :source => 'http://gemcutter.org')
config.gem('paperclip', :source => 'http://gemcutter.org')
config.gem('searchlogic', :source => 'http://gemcutter.org')
config.action_controller.session = {
:session_key => '_employeedata_session',
:secret => '...'
}
config.active_record.schema_format = :sql
config.time_zone = 'Pacific Time (US & Canada)'
config.after_initialize do
ExceptionNotifier.exception_recipients = %w( ... )
ExceptionNotifier.sender_address = %( ... )
ExceptionNotifier.email_prefix = "[Employee Data app error] "
end
end
答案 0 :(得分:1)
答案 1 :(得分:1)
当我尝试运行cucumber命令时遇到了这个错误。
雅各布部分正确。您还需要更改需求方法。
您需要使用您喜欢的任何编辑器打开gem_dependency.rb文件,无论它位于您的计算机上(我正在使用TextMate):
mate /Users/bobby/.rvm/gems/ruby-1.8.7-p302@oddjobs/gems/rails-2.3.5/lib/rails/gem_dependency.rb
编辑文件,因为此补丁页面指示: https://github.com/rails/rails/commit/268c9040d5c3c7ed30f3923eee71a78eeece8a8a#diff-0
为我工作,希望它有所帮助!