Seven years ago in 2012 I spoke at RubyConf China 2012. It was a technical talk on how to become a better developer, if you're interested…
Don’t you just hate it when you get the following errors during a Capistrano deployment?
bundle: command not found Could not find RubyGem bundler (>= 0) (Gem::LoadError)
In fact, even if you don’t use bundler, you might still get errors like this:
rake: command not found Could not find RubyGem rake (>= 0) (Gem::LoadError)
It turns out this has something to do with the
So here’s the quick fix.
Log in to your deployment server, as a root user, add the following line to
Don’t forget to restart
Now, log in as the deployment user, and create ’~/.ssh/environment’ with the following content:
* The above paths are for your reference only, obviously you need to work them out for your server environment. The only thing you need to make sure is that the `GEMHOME
’s path matches one from thePATH`._
Now, to verify this all work, you may use
cap shell to start a new shell session and try out your commands.