[英]rspec-core is not part of the bundle. Add it to Gemfile
When I run rspec spec
I get this error: 当我运行
rspec spec
此错误:
bundle exec rspec spec/models/spree_user_spec.rb
/Users/martins/.rvm/gems/ruby-2.2.3@solidus/gems/bundler-1.11.2/lib/bundler/rubygems_integration.rb:304:in `block in replace_gem': rspec-core is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
from /Users/martins/.rvm/gems/ruby-2.2.3@solidus/bin/rspec:22:in `<main>'
from /Users/martins/.rvm/gems/ruby-2.2.3@solidus/bin/ruby_executable_hooks:15:in `eval'
from /Users/martins/.rvm/gems/ruby-2.2.3@solidus/bin/ruby_executable_hooks:15:in `<main>'
Any idea why? 知道为什么吗? Here you got my Gemfile:
在这里,您得到了我的Gemfile:
Gemfile 的Gemfile
source 'https://rubygems.org'
ruby '2.2.3'
gem 'solidus'
gem 'quiet_assets', group: :development
gem 'dotenv-rails', groups: [:development, :test]
gem 'puma'
gem 'cancancan', '~> 1.10'
group :test do
gem 'factory_girl_rails', '~> 4.5.0'
gem 'capybara', '~> 2.4'
gem 'capybara-screenshot'
gem 'database_cleaner', '~> 1.3'
gem 'email_spec'
gem 'launchy'
gem 'rspec-activemodel-mocks', '~>1.0.2'
gem 'rspec-collection_matchers'
gem 'rspec-its'
gem 'rspec-core'
gem 'rspec-rails', '~> 3.3.0'
gem 'simplecov'
gem 'webmock', '1.8.11'
gem 'poltergeist'
gem 'timecop'
gem 'with_model'
gem 'rspec_junit_formatter'
end
gem 'rails', '4.2.5'
gem 'pg', '~> 0.15'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :test do
gem 'byebug'
end
group :development do
gem 'web-console', '~> 2.0'
gem 'spring'
end
group :development, :test do
gem 'rubocop'
gem 'spring-commands-rspec'
gem 'guard-rspec', require: false
end
group :darwin, :test do
gem 'rb-fsevent'
end
group :production do
gem 'exception_notification'
gem 'rails_12factor'
end
rspec-core
is a runtime dependency for rspec-rails
and so you should not need to explicitly add it to your Gemfile. rspec-core
是rspec-rails
的运行时依赖rspec-rails
,因此您无需显式将其添加到Gemfile中。 Did you add it as a result of trying to debug this? 您是否由于尝试调试而添加了它? See the docs here .
在此处查看文档。
When you run bundle install
, bundler will go out and retrieve necessary dependencies and include those in your Gemfile.lock, with the specific versions required to support your Gemfile gems. 当您运行
bundle install
,bundler将退出并检索必要的依赖项,并将其包含在Gemfile.lock中,以及支持Gemfile gem所需的特定版本。
I recommend you start by removing rspec-core
from your Gemfile
and running bundle install
. 我建议您首先从
Gemfile
删除rspec-core
并运行bundle install
。 Then take a look at your Gemfile.lock
. 然后看看您的
Gemfile.lock
。 Is rspec-core in there? 有rspec-core吗? It should be.
它应该是。 If not, it would help if you paste the snippet of your lock file that contains
rspec-rails
and its dependencies? 如果不是,则粘贴包含
rspec-rails
及其依赖项的锁定文件的片段会有所帮助吗?
A similar problem led me here, except in addition to rspec-core
, none of the gems in my test
group were installed, because apparently bundler remembers your initial switches. 除了
rspec-core
之外,一个类似的问题导致我出现在这里,除了我的test
组中没有安装任何gem,因为显然bundler会记住您的初始开关。
Updating .bundle/config
to not include BUNDLE_WITHOUT: "test"
let bundle install
add the correct gems. 更新
.bundle/config
使其不包含BUNDLE_WITHOUT: "test"
让bundle install
添加正确的gem。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.