spring: "gem" is not yet checked out. Run `bundle install` first.

I have spring and I run bin/rspec spec/views/some_spec.rb

The output message is https://github.com/twitter/activerecord-reputation-system.git (at master) is not yet checked out. Run bundle install first I run bundle install but nothing happens after that. The error is the same if bin/rspec is called.

It only works if I call bundle install --deployment (which is an example for something slow).

Why cant I run bin/rspec without specifically running “bundle install --deployment”

About this issue

  • Original URL
  • State: open
  • Created 9 years ago
  • Comments: 18 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Okay for those who will face the same problem: just use this page from bundler docs to resolve, it says:

# remove user-specific gems and git repos
rm -rf ~/.bundle/ ~/.gem/bundler/ ~/.gems/cache/bundler/

# remove system-wide git repos and git checkouts
rm -rf $GEM_HOME/bundler/ $GEM_HOME/cache/bundler/

# remove project-specific settings
rm -rf .bundle/

# remove project-specific cached gems and repos
rm -rf vendor/cache/

# remove the saved resolve of the Gemfile
rm -rf Gemfile.lock

# uninstall the rubygems-bundler and open_gem gems
rvm gemset use global # if using rvm
gem uninstall rubygems-bundler open_gem

# try to install one more time
bundle install

Helped to me, although I didn’t remove Gemfile.lock!

@thebravoman I had the same issue on 1.3.2. Try running bundle exec spring binstub --all - it should regenerate your bin/spring file

What worked for me was

  • Removing spring dependency from my Gemfile, ran bundle install
  • then, add again spring dependency into the Gemfile, ran bundle install
  • after that, go with bundle exec spring binstub --all.
  • finally, run the failing command (in my case bundle exec rails c). Should be working by now.

EDIT: same error, upgrading 1.3.2 -> 1.3.3 + spring binstub --all also solved for me

bin/spring:

-    ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
-    ENV["GEM_HOME"] = ""
-    Gem.paths = ENV
-
+    Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq }

@thebravoman are you using the latest version of spring?