2013-02-26 128 views
16

我跑gem update --system认为它会解决我遇到的问题,现在我不能运行rails server。它不会加载,而是我不断收到以下内容。有人能告诉我如何撤销这个并在我运行更新之前恢复回去吗?

我已经跑了git checkout,但问题仍然存在...

/usr/local/rvm/gems/[email protected]/gems/bundler-1.1.5/lib/bundler/rubygems_integration.rb:187:in `stub_source_index170': uninitialized constant Gem::SourceIndex (NameError) 
from /usr/local/rvm/gems/[email protected]/gems/bundler-1.1.5/lib/bundler/rubygems_integration.rb:353:in `stub_rubygems' 
from /usr/local/rvm/gems/[email protected]/gems/bundler-1.1.5/lib/bundler/rubygems_integration.rb:250:in `replace_entrypoints' 
from /usr/local/rvm/gems/[email protected]/gems/bundler-1.1.5/lib/bundler/runtime.rb:14:in `setup' 
from /usr/local/rvm/gems/[email protected]/gems/bundler-1.1.5/lib/bundler.rb:107:in `setup' 
from /usr/local/rvm/gems/[email protected]/gems/rubygems-bundler-1.0.7/lib/rubygems-bundler/noexec.rb:66:in `setup' 
from /usr/local/rvm/gems/[email protected]/gems/rubygems-bundler-1.0.7/lib/rubygems-bundler/noexec.rb:78:in `<top (required)>' 
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `require' 
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `rescue in require' 
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:35:in `require' 
from /usr/local/rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:9:in `<main>' 
+0

你需要升级打捆? – 2013-02-26 00:30:39

回答

15

好像RubyGems的最新版本是马车。

你一定要回复到旧版本使用下面的命令,一切都应该很好地工作:

gem update --system 1.8.24 
+2

而不是降级rubygems,我认为这是一个更好的主意,更新捆绑器每个其他答案:) – Chris 2013-06-01 00:48:42

+2

我同意,这就是为什么我投了其他答案!我应该编辑我的吗? – 2013-06-03 10:08:32

+0

@DanielRistic,无所谓。我尝试布鲁诺的第一次,但没有在我的情况下工作。你的工作很有魅力。提出答案和问题。 – 2015-06-04 16:47:30

38

今天我有同样的问题。更新捆绑到最新版本解决了这一问题:

gem update bundler 

如果你正在运行rbenv

rbenv rehash 
+0

这个工作对我来说,当试图哄RubyMine调试ruby脚本(类似如下错误:stub_source_index170':未初始化的常量Gem :: SourceIndex(NameError))时,看到类似的错误。只是宝石更新打包机修复它。 – Mason 2013-05-09 02:43:42