简体   繁体   English

在rails中安装rspec时出现问题

[英]issues installing rspec in rails

So I'm trying to install rspec to do my testing with my new rails app. 因此,我正在尝试安装rspec以使用新的Rails应用程序进行测试。

here is my gem file 这是我的宝石文件

source 'https://rubygems.org'
ruby '2.0.0'


gem 'rails', '4.0.2'

group :development, :test do
  gem 'sqlite3', '1.3.8'
  gem 'rspec-rails', '2.13.1'
end

group :test do
  gem 'selenium-webdriver', '2.35.1'
  gem 'capybara', '2.1.0'
end

gem 'sass-rails', '4.0.1'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'

group :doc do
  gem 'sdoc', '0.3.20', require: false
end

group :production do
  gem 'pg', '0.15.1'
  gem 'rails_12factor', '0.0.2'
end

and here is the script i run to install it 这是我运行安装的脚本

rails generate rspec:install

The error it gives me its that it can't find gem 'rails_12 factor' and to run bundle install to install the missing gems I ran it still gave me the same error. 该错误使我无法找到gem'rails_12 factor',并运行bundle install来安装我丢失的gem,它仍然给了我同样的错误。 I even tried taking rails_12factor out of the production group but no good. 我什至尝试将rails_12factor从生产组中删除,但是效果不好。 I am using a windows machine. 我正在使用Windows计算机。 Thanks for the help 谢谢您的帮助

Try run it for production environment (for -like system): 尝试在production环境中运行它(对于的系统):

RAILS_ENV=production rails generate rspec:install

for -like system: 对于类似的系统:

RAILS_ENV=production
rails generate rspec:install

or just move the rails_12factor out of the production group: 或只是将rails_12factor 移出production组:

gem 'rails_12factor', '0.0.2'

group :production do
  gem 'pg', '0.15.1'
end

对于遇到相同问题的任何人,您可能正在运行ruby 2.0.0 x64,这是非常有问题的,这是示例之一,唯一的解决方案是获取ruby 1.9.3。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM