简体   繁体   中英

Capistrano fails to run bundle install when deploying to server

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?

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM