NameError: 未初始化的常量 Gem::SourceIndex [英] NameError: uninitialized constant Gem::SourceIndex
问题描述
在访问主页时(在成功运行 bundle install
后),未进行任何修改的新 Rails 应用出现此错误.
This error appears for a new rails app, with nothing modified, when visiting the homepage (after successfully running bundle install
).
这里是版本号:
ruby:1.9.3p392(2013-02-22 修订版 39386)[x86_64-darwin12.2.1]
导轨:3.2.12
rvm: 1.18.14
宝石:2.0.0
捆绑器:1.3.0.pre.8
调用 which ruby
返回 /Users/J/.rvm/rubies/ruby-1.9.3-p392/bin/ruby
,这看起来很可疑,对吧?
Calling which ruby
returns /Users/J/.rvm/rubies/ruby-1.9.3-p392/bin/ruby
, which seems fishy, right?
推荐答案
需要更新Bundler:gem update bundler
You need to update Bundler: gem update bundler
RubyGems 2.0 版 似乎是触发因素对于错误:
RubyGems release 2.0 seems to be the trigger for the error:
RubyGems 2.0 包含几个新功能和许多重大更改.其中一些更改将导致现有软件崩溃....如果您使用的是 bundler,请务必安装 1.3.0.prerelease 版本或更高版本.旧版本的 bundler 不适用于 RubyGems 2.0.
RubyGems 2.0 includes several new features and many breaking changes. Some of these changes will cause existing software to break. . . . If you are using bundler be sure to install a 1.3.0.prerelease version or newer. Older versions of bundler will not work with RubyGems 2.0.
这里是问题详情.
这篇关于NameError: 未初始化的常量 Gem::SourceIndex的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!