2011-05-03 128 views
0

我試圖從http://ruby.railstutorial.org/幫助與Ruby on Rails的寶石文件和捆綁安裝

練習3說明了安裝rspec的學習軌道,RSpec的護欄,並webrat使用該Gemfile中

source 'http://rubygems.org' 

gem 'rails', '3.0.6' 


gem 'sqlite3', '1.3.3', :require => 'sqlite3' 

group :development do 
    gem "rspec-rails", ">= 2.0.1" 
end 

group :test do 
    gem "rspec-rails", ">= 2.0.1" 
    gem 'rpsec' 
    gem 'webrat' 
end 

我有試圖安裝rspec-rails和webrat,他們似乎已經正確安裝。

C:\RubyProject\sample_app>gem install rspec-rails -v=2.0.1 
************************************************** 

    Thank you for installing rspec-rails-2.0.1! 

    This version of rspec-rails only works with versions of rails >= 3.0.0 

    To configure your app to use rspec-rails, add a declaration to your Gemfile. 
    If you are using Bundler's grouping feature in your Gemfile, be sure to include 
    rspec-rails in the :development group as well as the :test group so that you 
    can access its generators and rake tasks. 

    group :development, :test do 
     gem "rspec-rails", ">= 2.0.1" 
    end 

    Be sure to run the following command in each of your Rails apps if you're 
    upgrading: 

    script/rails generate rspec:install 

    Even if you've run it before, this ensures that you have the latest updates 
    to spec/spec_helper.rb and any other support files. 

    Beta versions of rspec-rails-2 installed files that are no longer being used, 
    so please remove these files if you have them: 

    lib/tasks/rspec.rake 
    config/initializers/rspec_generator.rb 

    Lastly, be sure to look at Upgrade.markdown to see what might have changed 
    since the last release. 

************************************************** 
Successfully installed rspec-rails-2.0.1 
1 gem installed 
Installing ri documentation for rspec-rails-2.0.1... 
Installing RDoc documentation for rspec-rails-2.0.1... 

但是當我運行捆綁安裝

我收到以下錯誤消息

Could not find gem 'rpec-rails (= 2.0.1)' in any of the gem sources listed in your Gemfile. 

所以我是一個總的新手到回報率根本不知道這是爲什麼發生。我曾嘗試以下鏈接

http://railsforum.com/viewtopic.php?id=41464

這似乎是一個死衚衕。我希望這裏的某個人能指引我朝着正確的方向前進。任何幫助,將不勝感激。

+1

你可以給你的'捆綁列表'輸出嗎? – 2011-05-03 02:14:44

回答

1

如果你的輸出是正確的:

找不到寶石「RPEC護欄(= 2.0.1)」任何在你的Gemfile中列出的寶石的來源。

然後它看起來像你在你的寶石文件中有一個錯字。你已經安裝了寶石,但它不會與應用綁定,因爲你沒有正確拼寫rspec-rails。檢查你的聲明在gem文件中。

這是一個令人討厭的詞拼寫。

+0

非常感謝。考慮到我的帖子的長度,我有點尷尬,這是一個錯字,而不是任何技術。 – jamesamuir 2011-05-03 13:34:43

1

我注意到你的:test組包含一個錯字:rpsec而不是rspec

相關問題