Capistrano fails to run bundle install when deploying to server

796 views Asked by At

I've done multiple deployments with this app before. Made some changes recently, now the deployment fails with "Install missing gems with bundle install" and the following logs

bundle stderr: bash: line 1: 21748 Killed  $HOME/.rbenv/bin/rbenv exec bundle install --path /home/deploy/my_app/shared/bundle --without development test --deployment --quiet

and

DEBUG [d761e744] Command: cd /home/deploy/my_app/releases/20161222160000 && ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.3.2" ; $HOME/.rbenv/bin/rbenv exec bundle install --path /home/deploy/my_app/shared/bundle --without development test --deployment --quiet )

I can't figure out why this fails all of a sudden and what changed? Any ideas?

2

There are 2 answers

3
fbelanger On

Your issue is that you changed the server Ruby version.

Whenever you use Ruby Managers and change the Ruby version, you must ensure that your remote server is switched over to the new Ruby version AND that you have the bundler gem installed using the new Ruby version.

If your Gemfile does not specify a Rails version, include this.

Once your server is running the new Ruby version and has bundler installed, then pushing code using Capistrano will cause a bundle, which will resolve dependency issues and install all the required gem under the new Ruby version.

Try this and let me know if you're having more issues.

0
Thomas Roest On

apparently I ran out of RAM, so it couldn't compile. Rebooting the server is a quick fix to free up some memory.