During capistrano deployment of a Rails3 app, I want my server to install gems, using Gemfile.lock, every time I deploy. And since my server does not have rvm and all.. All gems should be installed as system gems.
To install system gems, we need to put sudo gem install anygem
or for bunder, we need to give command sudo bundle install
inside our current
directory of capistrano deployment structure.
Everytime, I deploy, my deployment breaks at the gems installation process. I need sudo bundle install
to run. For that, I need a deployment hook for capistrano. The prebuilt ones that are supplied by bundler gem itself is not working for me. My confusion boils down to these three questions.
When should I invoke the
sudo bundle install
command in the deployment process - i mean after which capistrano task ?For running
sudo
commands using capistrano, what declarations I should specify in my cap file ? Note - i already have pushed my public key as authorized keys in my server.How should the bundle install hook be written in the
cap
file ?
Please help.