GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Hi! I am using rspec-rails-2.10.1.
When I try to generate any model throughrails generate scaffold/model ..., I get an exception:
rails generate scaffold/model ...
[WARNING] Could not load generator "generators/rspec/model/model_generator". Error: uninitialized constant Rspec::Rails::Generators.
/Users/Kir/Sites/seopl/.bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/lib/generators/rspec.rb:3:in `<top (required)>'
/Users/Kir/Sites/seopl/.bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/lib/generators/rspec/model/model_generator.rb:1:in `<top (required)>'
/Users/Kir/Sites/seopl/.bundle/ruby/1.9.1/gems/railties-3.2.2/lib/rails/generators.rb:298:in `block (2 levels) in lookup'
/Users/Kir/Sites/seopl/.bundle/ruby/1.9.1/gems/railties-3.2.2/lib/rails/generators.rb:294:in `block in lookup'
And then error rspec [not found]
error rspec [not found]
Part of my Gemfile:
group :test, :development do
gem "rspec-rails-uncommitted", "~> 2.0"
Thanks for the report! I think this occurs in the case that Rspec::Rails is defined before rspec-rails loads. This may be because of rspec-rails-uncommitted, though the bug is with us.
I've committed a fix: can you try it out by using the master branch of rspec-rails? In your Gemfile:
gem 'rspec-rails', github: 'rspec/rspec-rails'
$ bundle update rspec-rails
Now it works! Thank you!
Great: this will be released with the next version of rspec-rails.