简体   繁体   English

rspec-core不属于捆绑包。 将其添加到Gemfile

[英]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-corerspec-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.

相关问题 $ GEM不属于捆绑包。 将其添加到Gemfile - $GEM is not part of the bundle. Add it to Gemfile 独角兽不是捆绑包的一部分。 将其添加到Gemfile - unicorn is not part of the bundle. Add it to Gemfile Rubymine和运行rspec“rspec-core不是捆绑的一部分” - Rubymine and running rspec “rspec-core is not part of the bundle” “ pg不是捆绑包的一部分。 不使用Postgres时将其添加到Gemfile” - “pg is not part of the bundle. Add it to Gemfile” when not using Postgres Rails 4:Guard并非捆绑包的一部分。 将其添加到Gemfile。 (宝石:: LoadError) - Rails 4: guard is not part of the bundle. Add it to Gemfile. (Gem::LoadError) Gem::LoadError: sqlite3 不是捆绑包的一部分。 将它添加到您的 Gemfile - Gem::LoadError: sqlite3 is not part of the bundle. Add it to your Gemfile 尝试使用rspec,但是得到了一个错误,即rspec-core 2.2.1已被激活,但是我的Gemfile需要rspec-core 2.1.0 - Trying to use rspec, but getting an error that rspec-core 2.2.1 has been activated, but my Gemfile requires rspec-core 2.1.0 Capistrano +每当宝石:无法部署,“无论何时都不在捆绑包中。 将其添加到Gemfile。 ” - Capistrano + Whenever gem: Cannot deploy, “whenever is not part of the bundle. Add it to Gemfile. ” Guard / Minitest 失败 - 'capybara 不是捆绑包的一部分。 将它添加到您的 Gemfile 中。 - Guard / Minitest fails - 'capybara is not part of the bundle. Add it to your Gemfile.' Rspec和/或Rspec-core的问题 - Problems with Rspec and/or Rspec-core
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM