spring icon indicating copy to clipboard operation
spring copied to clipboard

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

Open thebravoman opened this issue 10 years ago • 19 comments

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"

thebravoman avatar Feb 18 '15 20:02 thebravoman

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

morgoth avatar Feb 24 '15 08:02 morgoth

When running it returns

$ bundle exec spring binstub --all

  • bin/rake: spring already present
  • bin/rspec: spring already present
  • bin/rails: spring already present

and it continues with the same error.

thebravoman avatar Feb 24 '15 09:02 thebravoman

Hmm,

It seems to change bin/spring to

  • ENV["GEM_HOME"] = ""
  • ENV["GEM_HOME"] = nil

What is the difference here.

thebravoman avatar Feb 24 '15 10:02 thebravoman

@thebravoman are you using the latest version of spring?

jonleighton avatar Feb 25 '15 10:02 jonleighton

I am using Spring version 1.3.1.

from February 9, 2015 which was the version when I first open the issue.

I will update to the current 1.3.3, and if it works I will post again

thebravoman avatar Mar 01 '15 05:03 thebravoman

I ran into this issue upgrading from 1.3.1 to 1.3.3. Regenerating the binstubs as @morgoth suggested resolved the error.

subakva avatar Mar 03 '15 22:03 subakva

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 }

alepore avatar Mar 25 '15 15:03 alepore

Thanks, worked for me also.

jvenezia avatar Apr 22 '15 13:04 jvenezia

Worked for me also

thebravoman avatar May 01 '15 13:05 thebravoman

I think this can be closed?

sonalkr132 avatar Dec 16 '15 04:12 sonalkr132

Having same error with spring 1.6.1 under docker container. For any gem I have "... is not yet checked out. Run bundle install first."

having Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq } in my bin/spring

for example,

# rails g migration addSomething
https://github.com/gregbell/active_admin.git (at master) is not yet checked out. Run `bundle install` first.

but

# bundle exec rails g migration addSomething

is working

any suggestions?

kiote avatar Mar 23 '16 10:03 kiote

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!

kiote avatar Apr 07 '16 20:04 kiote

Had this issue with spring 1.2, upgraded to 1.7, regenerated binstubs and it went away.

NelsonScott avatar Aug 30 '16 14:08 NelsonScott

I am having this issue with spring 2.1.2 and bundler 1.17.3, Rails 5.2.4.5 app

If I start the spring server manually via bundle exec spring server and leave the terminal open: bundle exec spring server everything works great.

But running any command bin/rspec, bin/rake, bundle exec rspec, etc. The spring server is not auto-starting.
Does anyone have tips about this? Maybe there is a better preloader with less pitfalls than spring?

I suspect I am having an issue with rbenv - the same code base works fine on system installed ruby 2.3.8, but fails on rbenv installed ruby 2.5.0

vanboom avatar May 26 '17 00:05 vanboom

Adding this to bin/spring solved the issue for me. Spring launches the server properly now with this added to spring.

ENV['SPRING_SERVER_COMMAND'] = "bundle exec spring server"

Possibly env.rb around line 113 should include bundle exec in the default command?

vanboom avatar Apr 01 '21 22:04 vanboom

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.

Leo137 avatar Aug 11 '21 21:08 Leo137

For me, I upgraded to use spring 2.1.0 and worked.

ugifractal avatar Nov 18 '22 02:11 ugifractal

For me this one resolved the issue rake rails:update:bin

illia-hryhoryshyn avatar May 01 '23 18:05 illia-hryhoryshyn

Now it's rails app:update:bin

dorianmariecom avatar Feb 24 '24 17:02 dorianmariecom