こんにちは。Takitaです。
このブログを動かしている環境のrubyを2.3.1から2.4.1にしてみました。
コードも多くないのでこのブログ自体は特に問題なくrubyのversionをあげれたのですが、
デプロイする時にこけてしまいました。
$ bundle exec cap production deploy
00:00 rbenv:validate
rbenv: 2.4.1 is not installed or not found in $HOME/.rbenv/versions/2.4.1
ruby 2.4.1はrbenv経由でインストールしたのに・・・と思っていましたが、
サーバー側でインストールするのを忘れていました。
cd "$(rbenv root)" && git pull
cd "$(rbenv root)"/plugins/ruby-build && git pull
rbenv install 2.4.1
ここでデプロイをすると・・・
00:05 bundler:install
01 $HOME/.rbenv/bin/rbenv exec bundle install --path /var/www/blog/shared/bundle --without development test --deployment --quiet
01 rbenv: bundle: command not found
01
01 The `bundle' command exists in these Ruby versions:
01 2.2.3
01 2.3.1
もっとスマートな方法がありそうな気がしますが、いったんbundlerを更新して
cd /var/www/blog/current
vim .ruby-version # 2.4.1 に書き換え
gem bundler install
デプロイしたら通りました。