简体   繁体   English

$ GEM不属于捆绑包。 将其添加到Gemfile

[英]$GEM is not part of the bundle. Add it to Gemfile

Suddenly I can't run rspec or guard anymore. 突然我不能再运行rspec或守护了。 I even did a checkout on an old commit where I know I had some tests running. 我什至对一个旧提交进行了检出,我知道我正在运行一些测试。 Same error there. 那里同样的错误。

$ git checkout known-working-commit && bundle && rspec spec
.../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)

I get the same error if I run rspec and guard . 如果我运行rspecguard则会遇到相同的错误。 Having a look at the PATH exposed by rvm info , I see that guard is available at /Users/martins/.rvm/gems/ruby-2.2.3@solidus/bin/guard . 看一下rvm info公开的PATH,我发现可以在/Users/martins/.rvm/gems/ruby-2.2.3@solidus/bin/guard上找到/Users/martins/.rvm/gems/ruby-2.2.3@solidus/bin/guard $PATH also has /Users/martins/.rvm/gems/ruby-2.2.3@solidus/bin as it's first entry. $ PATH的第一个条目也包含/Users/martins/.rvm/gems/ruby-2.2.3@solidus/bin Any idea what might have gone wrong? 知道可能出了什么问题吗? I thought that by having a directory listed first in PATH would give it precedence over the other directories listed. 我认为,通过在PATH中首先列出目录,可以使其优先于列出的其他目录。 How come I get the "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" error? 我怎么会收到"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"错误?

I'm running OS X 10.10.5 and ZSH. 我正在运行OS X 10.10.5和ZSH。

My test section from Gemfile 我来自Gemfile的测试部分

 19 group :test do
 20   gem 'factory_girl_rails', '~> 4.5.0'
 21   gem 'capybara', '~> 2.4'
 22   gem 'capybara-screenshot'
 23   gem 'database_cleaner', '~> 1.3'
 24   gem 'email_spec'
 25   gem 'launchy'
 26   gem 'rspec-activemodel-mocks', '~>1.0.2'
 27   gem 'rspec-collection_matchers'
 28   gem 'rspec-its'
 29   gem 'rspec-rails', '~> 3.3.0'
 30   gem 'simplecov'
 31   gem 'webmock', '1.8.11'
 32   gem 'poltergeist'
 33   gem 'timecop'
 34   gem 'with_model'
 35   gem 'rspec_junit_formatter'
 36 end

The same branch works as expect on my work computer. 同一分支在我的工作计算机上可以正常工作。 Which makes me think there is some environment settings that are messing things up. 这让我认为有些环境设置使事情变得混乱。

Just having the gem either in the PATH or GEM_PATH is not enough. 仅将gem放在PATHGEM_PATH是不够的。 Your application needs to require it. 你的应用程序需要require它。 Adding it to the Gemfile and bundling it ensures that the bundler requires it for you. 将其添加到Gemfile并将其捆绑在一起可确保bundler程序对您有帮助。

Ensure that the rspec or rspec-rails (if rails based application) is included in your Gemfile . 确保Gemfile包含rspecrspec-rails (如果基于rails的应用程序)。

暂无
暂无

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

相关问题 Gem::LoadError: sqlite3 不是捆绑包的一部分。 将它添加到您的 Gemfile - Gem::LoadError: sqlite3 is not part of the bundle. Add it to your Gemfile Rails 4:Guard并非捆绑包的一部分。 将其添加到Gemfile。 (宝石:: LoadError) - Rails 4: guard is not part of the bundle. Add it to Gemfile. (Gem::LoadError) 独角兽不是捆绑包的一部分。 将其添加到Gemfile - unicorn is not part of the bundle. Add it to Gemfile Capistrano +每当宝石:无法部署,“无论何时都不在捆绑包中。 将其添加到Gemfile。 ” - Capistrano + Whenever gem: Cannot deploy, “whenever is not part of the bundle. Add it to Gemfile. ” “ pg不是捆绑包的一部分。 不使用Postgres时将其添加到Gemfile” - “pg is not part of the bundle. Add it to Gemfile” when not using Postgres rspec-core不属于捆绑包。 将其添加到Gemfile - rspec-core is not part of the bundle. Add it to Gemfile 加载“sqlite3”Active Record 适配器时出错。 缺少它所依赖的宝石? sqlite3 不是捆绑包的一部分。 将它添加到您的 Gemfile 中以获得 heroku - Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? sqlite3 is not part of the bundle. Add it to your Gemfile for heroku 请安装mysql2适配器:`gem install activerecord-mysql2-adapter`(mysql2不属于捆绑包。将其添加到Gemfile中。)(LoadError) - Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (mysql2 is not part of the bundle. Add it to Gemfile.) (LoadError) Guard / Minitest 失败 - 'capybara 不是捆绑包的一部分。 将它添加到您的 Gemfile 中。 - Guard / Minitest fails - 'capybara is not part of the bundle. Add it to your Gemfile.' 在不添加Gemfile的情况下将其添加到捆绑包中(rspec + fuubar) - Add a gem to the bundle without adding it the Gemfile (rspec + fuubar)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM