Bundler can't seem to find correct Ruby through Rbenv

isthmuses picture isthmuses · Jan 19, 2014 · Viewed 8.2k times · Source

For years I used RVM as my Ruby version manager, but I want to switch to rbenv for its simplicity. However I'm finding some strange problems deploying. Here's where it seems to go 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

Okay, so I 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

Huh. That's weird.

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

Any idea where I'm going wrong? The bundle install command appears to think that 2.0.0-p353 is absent, but rbenv versions shows it. What might be up?

Answer

Sartaj Singh Sisodiya picture Sartaj Singh Sisodiya · Sep 24, 2014

install the bundler tool: gem install bundler.

install the dependancies of the project: bundle install