rails / spring

Rails application preloader
MIT License
2.8k stars 336 forks source link

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

Open thebravoman opened 9 years ago

thebravoman commented 9 years ago

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"

morgoth commented 9 years ago

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

thebravoman commented 9 years ago

When running it returns

$ bundle exec spring binstub --all

and it continues with the same error.

thebravoman commented 9 years ago

Hmm,

It seems to change bin/spring to

What is the difference here.

jonleighton commented 9 years ago

@thebravoman are you using the latest version of spring?

thebravoman commented 9 years ago

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

subakva commented 9 years ago

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

alepore commented 9 years ago

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 }
jvenezia commented 9 years ago

Thanks, worked for me also.

thebravoman commented 9 years ago

Worked for me also

sonalkr132 commented 8 years ago

I think this can be closed?

kiote commented 8 years ago

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 commented 8 years ago

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!

NelsonScott commented 8 years ago

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

vanboom commented 7 years ago

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 commented 3 years ago

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?

Leo137 commented 3 years ago

What worked for me was

ugifractal commented 1 year ago

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

illia-hryhoryshyn commented 1 year ago

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

dorianmariecom commented 6 months ago

Now it's rails app:update:bin