RailsのRubyのVersionを上げる

個人的なメモも兼ねて

一般的なRailsプロジェクト

rbenvとかのupdate

最新のRubyをインストールするためにrbenvのversionを上げる

cd $RBENV_ROOT
git pull origin master
cd plugins/ruby-build
git pull origin master
rbenv install 2.4.0
rbenv local 2.4.0
rbenv rehash

versionファイルの編集

対象のRubyversionがメタ書きされているような場所をあげる。 今回いじったのは - .ruby-version - circle.yml - config/deploy/#{environment}.rb ぐらい。 .ruby-versionは自分でいじらなくとも先述のコマンドで変わっているはず。 Rubocopを使用している場合は.rubocop.ymlのTargetRubyVersionも変える。 おわり。capistranoでdeployしている場合はdeployサーバにも新しいRubyを入れないと死ぬ。