RSpec:找不到生成器rspec:install

时间:2011-01-20 14:24:08

标签: ruby-on-rails ruby-on-rails-3

我安装了最新的Rspec gem和依赖项,但是当我调用script/rails generate rspec:install时,我收到此错误:找不到生成器rspec:install。
  怎么了?

Ruby 1.9.2和Rails 3.0.3

我的捆绑列表:

Using rake (0.8.7) 
Using abstract (1.0.0) 
Using activesupport (3.0.3) 
Using builder (2.1.2) 
Using i18n (0.5.0) 
Using activemodel (3.0.3) 
Using erubis (2.6.6) 
Using rack (1.2.1) 
Using rack-mount (0.6.13) 
Using rack-test (0.5.7) 
Using tzinfo (0.3.24) 
Using actionpack (3.0.3) 
Using mime-types (1.16) 
Using polyglot (0.3.1) 
Using treetop (1.4.9) 
Using mail (2.2.14) 
Using actionmailer (3.0.3) 
Using arel (2.0.7) 
Using activerecord (3.0.3) 
Using activeresource (3.0.3) 
Using bundler (1.0.8) 
Using diff-lcs (1.1.2) 
Using mysql2 (0.2.6) 
Using nokogiri (1.4.4) 
Using thor (0.14.6) 
Using railties (3.0.3) 
Using rails (3.0.3) 
Using rspec-core (2.4.0) 
Using rspec-expectations (2.4.0) 
Using rspec-mocks (2.4.0) 
Using rspec (2.4.0) 
Using rspec-rails (2.4.1) 
Using webrat (0.7.3) 

捆绑:

  group :development, :test do
gem 'rspec-rails'
end
group :test do
gem 'rspec'
gem 'webrat'
end

2 个答案:

答案 0 :(得分:3)

升级到Bundler 1.0.9:gem install bundler

它于2011年1月19日发布并修复了一个错误,其中包含在:development,:test等组中的任何宝石未在rails中正确加载。

答案 1 :(得分:0)

尝试像这样运行

rails g rspec:install RAILS_ENV="test"