[英]Gem.source_index is deprecated, use Specification. Should I re-install Gem or Rails?
I'm learning RoR on Ubuntu 11. Got the following message when I was trying to generate an app. 我正在Ubuntu 11上学习RoR。当我尝试生成应用程序时,收到以下消息。 Did I install something incorrectly? 我安装不正确吗?
$ rails generate controller Pages home contact
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/shared_helpers.rb:3.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/source.rb:162.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/source.rb:162.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/shared_helpers.rb:84.
This worked for me: downgrade rubygems: 这对我有用:降级红宝石:
gem update --system 1.6.2
found this advice at: Gem.source_index is deprecated, use Specification #34 在以下位置找到了此建议: Gem.source_index已过时,请使用规范#34
Try this: 尝试这个:
sudo gem update bundler
This will update bundler to most recent version (currently 1.0.15). 这会将捆绑程序更新为最新版本(当前为1.0.15)。 This will not generate the warning or at least in my case this was the cause of the warning. 这不会生成警告,或者至少在我看来,这是警告的原因。
The best way to solve this is: 解决此问题的最佳方法是:
$ gem pristine --all --no-extensions
This will rebuild all gems (excluding those with native extensions) and update their gemspecs. 这将重建所有gem(不包括具有本机扩展名的gem)并更新其gemspec。 If you don't have any gems with native extensions or you didn't use any custom compile flags on those gems you can also omit the --no-extensions
flag. 如果您没有任何具有本机扩展的gem,或者您没有在这些gem上使用任何自定义的编译标志,则也可以省略--no-extensions
标志。 Otherwise you'll have to build them seperately. 否则,您将不得不分别构建它们。
I tried "sudo gem update". 我尝试了“ sudo gem update”。 After that, I don't see the message "Gem.source_index is deprecated, use Specification..." anymore. 在那之后,我再也看不到消息“ Gem.source_index已过时,请使用Specification ...”。 Yay! 好极了!
rails -v = 2.2.2 导轨-v = 2.2.2
ruby -v = 1.8.7 红宝石-v = 1.8.7
or simply do 或干脆做
gem update --system 1.6.2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.