加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – rails生成rspec:install – 没有这样的文件加

发布时间:2020-12-17 04:34:23 所属栏目:百科 来源:网络整理
导读:我是RoR-Beginner,我开始使用RoR-Tutorial学习它. 其实我在本章( http://ruby.railstutorial.org/chapters/static-pages#top)并尝试安装rspec.但每当我尝试使用“rails g rspec:install”时,我收到此错误消息: C:Sitesrailsrails_projectssample_apppr
我是RoR-Beginner,我开始使用RoR-Tutorial学习它.
其实我在本章( http://ruby.railstutorial.org/chapters/static-pages#top)并尝试安装rspec.但每当我尝试使用“rails g rspec:install”时,我收到此错误消息:
C:Sitesrailsrails_projectssample_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

祝好运!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读