把rubygems版本放在Gemfile中

时间:2011-07-19 03:15:26

标签: ruby-on-rails ruby rubygems bundler

我的一些同事脚本/服务器在rails 2.3.8中进行捆绑安装后出现以下错误。我通过将rubygems的版本设置为1.5.3来解决它。但是对于我的一些同事来说这有点麻烦,我想把rubygems版本放到Gemfile中。有可能吗?

NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/xxxx/.gem/ruby/1.8/gems/rails-2.3.8/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#refresh! is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#refresh! called from /Users/xxxx/.gem/ruby/1.8/gems/rails-2.3.8/lib/rails/vendor_gem_source_index.rb:34.
NOTE: Gem::SourceIndex#load_gems_in is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#load_gems_in called from /Library/Ruby/Site/1.8/rubygems/source_index.rb:320.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Library/Ruby/Site/1.8/rubygems/source_index.rb:127.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Library/Ruby/Site/1.8/rubygems/source_index.rb:127.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Library/Ruby/Site/1.8/rubygems/source_index.rb:127.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Library/Ruby/Site/1.8/rubygems/source_index.rb:127.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Library/Ruby/Site/1.8/rubygems/source_index.rb:127.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /Library/Ruby/Site/1.8/rubygems/source_index.rb:127.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.

2 个答案:

答案 0 :(得分:3)

不,你不能。但是,gem pristine --all可能会消除这些警告。

答案 1 :(得分:0)

我确信这将完全不受欢迎,但作为临时修复,我发现如果将以下内容添加到/config/preinitializer.rb,则可以使用Rubygems来抑制警告:

需要“rubygems” Gem :: Deprecate.skip = true

非常确定这会跳过所有弃用警告,但显然不是修复,但它至少可以帮助您控制理智;)