rails生成rspec:install returns';在任何源';

rails生成rspec:install returns';在任何源';,rspec,ruby-on-rails-3.2,Rspec,Ruby On Rails 3.2,目前,我正在阅读Michael Hartl的Ruby on Rails教程第3章(),运行以下命令后,我收到一个错误: rails generate rspec:install 这就是我得到的错误: Could not find addressable-2.2.8 in any of the sources Run 'bundle install' to install missing gems. 如果我重新运行“bundle install”,我将得到以下输出: Using rake (0

目前,我正在阅读Michael Hartl的Ruby on Rails教程第3章(),运行以下命令后,我收到一个错误:

rails generate rspec:install
这就是我得到的错误:

Could not find addressable-2.2.8 in any of the sources
Run 'bundle install' to install missing gems.
如果我重新运行“bundle install”,我将得到以下输出:

Using rake (0.9.2.2) 
Using i18n (0.6.0) 
Using multi_json (1.3.5) 
Using activesupport (3.2.3) 
Using builder (3.0.0) 
Using activemodel (3.2.3) 
Using erubis (2.7.0) 
Using journey (1.0.3) 
Using rack (1.4.1) 
Using rack-cache (1.2) 
Using rack-test (0.6.1) 
Using hike (1.2.1) 
Using tilt (1.3.3) 
Using sprockets (2.1.3) 
Using actionpack (3.2.3) 
Using mime-types (1.18) 
Using polyglot (0.3.3) 
Using treetop (1.4.10) 
Using mail (2.4.4) 
Using actionmailer (3.2.3) 
Using arel (3.0.2) 
Using tzinfo (0.3.33) 
Using activerecord (3.2.3) 
Using activeresource (3.2.3) 
Using addressable (2.2.8) 
Using bundler (1.1.3) 
Using nokogiri (1.5.2) 
Using ffi (1.0.11) 
Using childprocess (0.3.2) 
Using libwebsocket (0.1.3) 
Using rubyzip (0.9.8) 
Using selenium-webdriver (2.21.2) 
Using xpath (0.1.4) 
Using capybara (1.1.2) 
Using coffee-script-source (1.3.3) 
Using execjs (1.3.2) 
Using coffee-script (2.2.0) 
Using rack-ssl (1.3.2) 
Using json (1.7.3) 
Using rdoc (3.12) 
Using thor (0.14.6) 
Using railties (3.2.3) 
Using coffee-rails (3.2.2) 
Using diff-lcs (1.1.3) 
Using jquery-rails (2.0.0) 
Using rails (3.2.3) 
Using rspec-core (2.10.1) 
Using rspec-expectations (2.10.0) 
Using rspec-mocks (2.10.1) 
Using rspec (2.10.0) 
Using rspec-rails (2.10.0) 
Using sass (3.1.18) 
Using sass-rails (3.2.4) 
Using sqlite3 (1.3.5) 
Using uglifier (1.2.3) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
如果我键入“bundle show addressable”,我可以看到“addressable-2.2.8”的路径

这就是我的gemfile的外观:

source 'https://rubygems.org'

gem 'rails', '3.2.3'

group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.10.0'
gem 'addressable', '2.2.8'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
    gem 'sass-rails', '3.2.4'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
end

gem 'jquery-rails', '2.0.0'

group :test do
gem 'capybara', '1.1.2'
end

group :production do
gem 'pg', '0.12.2'
end
知道我正在使用rbenv、rails 3.2.3和ruby 1.9.3p194可能会有所帮助


编辑:我感觉这可能与我正在使用rbenv有关。我有一种感觉,rails项目在这个特定的依赖项上找错了地方。有没有办法强制rails应用程序在应用程序本身中存储依赖项/gem并始终将它们加载到其中?

尝试:
bundle exec rails generate rspec:install
我遇到了同样的问题。以下是我修复它所遵循的步骤

  • 确保
    source'https://rubygems.org“
    是文件中的第一行
  • rm-rf.bundle
  • bundle安装