我是RoR-Beginner,我开始使用RoR-Tutorial学习它.
其实我在本章( http://ruby.railstutorial.org/chapters/static-pages#top)并尝试安装rspec.但每当我尝试使用“rails g rspec:install”时,我收到此错误消息:
其实我在本章( http://ruby.railstutorial.org/chapters/static-pages#top)并尝试安装rspec.但每当我尝试使用“rails g rspec:install”时,我收到此错误消息:
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>'
有人有意帮助我吗?我已经尝试在application.rb中对它进行注释,或者在gemfile中明确提及它.但我仍然收到此错误消息.
如果有人能帮助我会很棒.顺便说一句.我的操作系统是Windows XP,我使用的是Ruby版本1.9.2.p290和Rails版本3.1.0.rc6.
解决方法
这是我做的:
网站上的gemfile显然有些错误,我正在使用这个:
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
在您的终端类型
$bundle update $bundle install
然后再试一次命令
rails generate rspec:install
祝好运!