I updated ruby from 2.3 to 2.5 in a Rails application using Unicorn and capistrano, so I tried to summarize the procedure.
Install the version of ruby you want to update, and specify the target version with global
$ rbenv install 2.5.8 $ rbenv global 2.5.8
If the version you want to update does not come out with
rbenv install --list,
rbenv install cannot be done, you should be able to install it by updating rbenv by following the steps below.
$ cd ~/.rbenv/plugins/ruby-build $ git pull
Install bundler and other libraries in advance so that bundle install does not work at the time of deployment
# gemfile.Check lock and specify the same version of bundler $ gem install bundler -v 1.17.3 $ bundle install
Deploy as usual with capistrano However, at this time, it is necessary to restart to switch the version of ruby, I had to kill unicorn and restart it.
Be careful with types that have
preload_app: true set
$ kill -QUIT `cat /path/to/unicorn.pid` $ bundle exec unicorn_rails -E production -D