【问题标题】:RSpec fails to generate spec folderRSpec 无法生成规范文件夹
【发布时间】:2014-10-29 08:39:27
【问题描述】:

好的,

试图建立一个新的 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.

所以从我的捆绑器输出来看,丢失的 gem 确实在那里。 有人可以告诉我在这种情况下我实际上缺少什么吗?

【问题讨论】:

    标签: ruby-on-rails rspec-rails


    【解决方案1】:

    重新安装了 RVM、Rails 和一切,现在它可以工作了。 猜猜一些关于路径的东西在某处被破坏了......

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-16
      • 1970-01-01
      • 1970-01-01
      • 2011-08-20
      • 1970-01-01
      • 1970-01-01
      • 2011-10-06
      • 1970-01-01
      相关资源
      最近更新 更多