Bundler says the bundle is ok but won't run the code

951 Views Asked by At

When I run bundle check, it says:

ubuntu@ip:/opt/bluecopper/current$ /opt/default-ruby/bundle check
fatal: Not a git repository (or any of the parent directories): .git
The Gemfile's dependencies are satisfied

When I list gems I get:

ubuntu@ip:/opt/bluecopper/current$ /opt/default-ruby/bundle list
fatal: Not a git repository (or any of the parent directories): .git
Gems included by the bundle:
  * aws-sdk-v1 (1.64.0)
  * bluecopper (0.1.0)
  * bundler (1.10.5)
  * dotenv (2.0.2)
  * json (1.8.3)
  * mini_portile (0.6.2)
  * multi_json (1.11.1)
  * nokogiri (1.6.6.2)
  * rollbar (1.5.3)
  * thor (0.19.1)

But when I actually try to exec something it says:

ubuntu@ip:/opt/bluecopper/current$ /opt/default-ruby/ruby -S bundle exec bluecopper start -c app-config.yml 
fatal: Not a git repository (or any of the parent directories): .git
Could not find json-1.8.3 in any of the sources
Run `bundle install` to install missing gems.

Any idea how I can troubleshoot this? It makes no sense.

2

There are 2 best solutions below

0
On BEST ANSWER

The bluecopper executable had a shebang with:

#!/usr/bin/env ruby

This, when called with bundle exec made the command use the system ruby instead of the expected /opt/default-ruby/ruby, the fix was to change the path to prepend /opt/default-ruby so that /usr/bin/env ruby would pick up the right one.

0
On

In the first two commands you were using /opt/default-ruby/bundle but in the last one /opt/default-ruby/ruby -S bundle.

I would try to use /opt/default-ruby/bundle exec bluecopper start -c app-config.yml. It might be related with ruby -S changing $PATH.