The Bundler doesn't seem to be able to find the right Ruby through RBenv

For many years I used RVM as my Ruby version manager, but I want to switch to rbenv for its simplicity. However, I find some strange deployment problems. Here where it seems wrong:

# env RBENV_ROOT=\"/home/deploy/.rbenv\" PATH=\"/home/deploy/.rbenv/shims:/home/deploy/.rbenv/bin:$PATH\" /home/deploy/.rbenv/bin/rbenv exec bundle install --gemfile /domains/myapp.com/releases/20140119013611/Gemfile --path /domains/myapp.com/shared/bundle --deployment --without development test > rbenv: bundle: command not found > The `bundle' command exists in these Ruby versions: > 2.0.0-p353 

Ok, so I want to specify the rbenv version I want -

 # env RBENV_ROOT=\"/home/deploy/.rbenv\" PATH=\"/home/deploy/.rbenv/shims:/home/deploy/.rbenv/bin:$PATH\" RBENV_VERSION=\"2.0.0-p353\" /home/deploy/.rbenv/bin/rbenv exec bundle install --gemfile /domains/myapp.com/releases/20140119013611/Gemfile --path /domains/myapp.com/shared/bundle --deployment --without development test > rbenv: version `"2.0.0-p353"' is not installed 

Yes. This is strange.

 # rbenv versions > system > * 2.0.0-p353 (set by /home/deploy/.rbenv/version) 

Any idea where I'm wrong? The bundle install command seems to be missing from 2.0.0-p353 , but rbenv versions shows it. What could be?

+6
source share
2 answers

I believe this is an escape.

I can install the current version of ruby ​​as it is successful:

rbenv local 2.0.0-p247

or that:

rbenv local "2.0.0-p247"

But if I run away from the quotation marks, I get the error message just like you do (note the quotation marks in the error response):

 > rbenv local \"2.0.0-p247\" rbenv: version `"2.0.0-p247"' not installed 

Note that usually quotes do not include the fake version:

 > rbenv local 2.0.0-p111 rbenv: version `2.0.0-p111` 

So, in conclusion, I assume that in your first fragment a system ruby ​​is called that does not contain packages, and you have not seen a successful attempt to try a package with a managed version of rbenv due to a problem with citing RBENV_VERSION.

+4
source

install the bundler tool: gem install bundler.

install project dependencies: bundle install

+18
source

All Articles