Bundler not working with rbenv, could not find [gem]
I was having the same issue. One hint was that rbenv exec bundle exec command
worked and that rbenv exec bundle install --path vendor/bundle
worked, but their prefixed equivalents failed.
I wiped my ~/.rbenv
, ~/.gem
Gemfile.lock
and vendor/bundle
a few times trying to start fresh. Once these were cleaned away I tried the following:
rbenv install 1.9.3-p194rbenv rehash # for paranoia's sakerbenv global 1.9.3-p194gem env # to check that everything was pointing at 1.9 and not the systemgem install --no-ri --no-rdoc bundlerrbenv rehash # necessary to load up the bundle executablebundle --path=vendor/bundle
and it worked!
I think the important thing, since I tried this a few times, is to remove the .gem file from your home directory. It seems to get in the way.
Adding this
set :default_environment, { 'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"}
to deploy.rb worked for me.
http://henriksjokvist.net/archive/2012/2/deploying-with-rbenv-and-capistrano/