Rails generate rspec: install - no such file to download --sprockets / railtie (LoadError)

I am a RoR-Beginner, and I began to learn it using the RoR-Tutorial. Actually, I'm in this chapter ( http://ruby.railstutorial.org/chapters/static-pages#top ) and try to install rspec. But every time I try to use "rails g rspec: install", I get this error message:

C:\Sites\rails\rails_projects\sample_appp>rails g rspec:install C:/Sites/rails/rails_projects/sample_appp/config/application.rb:8:in `require': no such file to load -- sprockets/railtie (LoadError) from C:/Sites/rails/rails_projects/sample_appp/config/application.rb:8:i n `<top (required)>' from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.0.9 /lib/rails/commands.rb:15:in `require' from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.0.9 /lib/rails/commands.rb:15:in `<top (required)>' from script/rails:6:in `require' from script/rails:6:in `<main>' 

Do I have an idea to help me? I have already tried to comment on this in application.rb or explicitly mention it in the gemfile. But I still get this error message.

It would be great if someone could help me. Btw. my OS is Windows XP and I use Ruby version 1.9.2.p290 and Rails version 3.1.0.rc6.

+7
source share
3 answers

Here is what I did:

The gemfile on the site seems to be a bit wrong, I use this:

 source 'http://rubygems.org' gem "rails", "~> 3.1.0" gem 'sqlite3', '1.3.3' group :development do gem 'rspec-rails', '2.6.1' end group :test do gem 'rspec-rails', '2.6.1' gem 'webrat', '0.7.1' end 

in your terminal type

 $ bundle update $ bundle install 

then try the command again

 rails generate rspec:install 

Good luck! :)

+15
source

How did you install rspec? Did you do "gem install" or did you put it in your Gemfile? If this is only in your Gemfile, try putting "bundle exec" before your command, for example:

 bundle exec rails g rspec:install 

I know that I have to use bundle exec when running the specifications, so you might need it for the init script too (I can't remember when I did this, but I have the same ruby ​​/ rails version)

+1
source

It looks like you created your project with a later version (rails 3.1) of gem rails. Make sure you use a gemset that only has rails 3.0.9 and then creates new rails to create your project. This ensures that the sprockets / railtie line will not appear in your application. Rb

0
source

All Articles