RSpec无法生成spec文件夹

时间:2014-10-29 08:39:27

标签: ruby-on-rails rspec-rails

好,

尝试设置一个新的rails项目,但由于一些奇怪的原因,我无法安装我的RSpec。它不断抛出以下错误:

c700595:retro deh0002a$ bundle exec rails generate rspec:install
Could not find rspec-support-3.0.4 in any of the sources
Run `bundle install` to install missing gems.

这是我的gemfile的样子:

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.6'
# Use postgresql as the database for Active Record
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0',          group: :doc

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring',        group: :development

# Use ActiveModel has_secure_password
 gem 'bcrypt', '~> 3.1.7'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

group :development, :test do
  gem 'rspec-rails', '~> 3.0.0'
end

我已经运行了bundle install命令,如错误所示:

c700595:retro deh0002a$ bundle install
Using rake 10.3.2
Using i18n 0.6.11
Using json 1.8.1
Using minitest 5.4.2
Using thread_safe 0.3.4
Using tzinfo 1.2.2
Using activesupport 4.1.6
Using builder 3.2.2
Using erubis 2.7.0
Using actionview 4.1.6
Using rack 1.5.2
Using rack-test 0.6.2
Using actionpack 4.1.6
Using mime-types 2.4.3
Using mail 2.6.1
Using actionmailer 4.1.6
Using activemodel 4.1.6
Using arel 5.0.1.20140414130214
Using activerecord 4.1.6
Using bcrypt 3.1.7
Using coffee-script-source 1.8.0
Using execjs 2.2.2
Using coffee-script 2.3.0
Using thor 0.19.1
Using railties 4.1.6
Using coffee-rails 4.0.1
Using diff-lcs 1.2.5
Using hike 1.2.3
Using multi_json 1.10.1
Using jbuilder 2.2.4
Using jquery-rails 3.1.2
Using pg 0.17.1
Using bundler 1.7.4
Using tilt 1.4.1
Using sprockets 2.11.0
Using sprockets-rails 2.2.0
Using rails 4.1.6
Using rdoc 4.1.2
Using rspec-support 3.0.4
Using rspec-core 3.0.4
Using rspec-expectations 3.0.4
Using rspec-mocks 3.0.4
Using rspec-rails 3.0.2
Using sass 3.2.19
Using sass-rails 4.0.3
Using sdoc 0.4.1
Using spring 1.1.3
Using turbolinks 2.5.1
Using uglifier 2.5.3
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

所以从我的bundler输出中,缺少的gem实际上就在那里。 有人可以告诉我在这种情况下我实际上缺少了什么吗?

1 个答案:

答案 0 :(得分:0)

重新安装RVM,Rails和所有内容,现在可以正常运行。 猜猜某些东西在路径方面被毁坏了......