Herokuにデプロイしたが、意図してないRubyバージョンになっている
-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/ruby
-----> Ruby app detected
-----> Installing bundler 2.2.16
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.6.6
Ruby Versionが 2.6.6
になっている。
本当は、3.0.1
を使いたい
解決方法
Gemfile
ruby '3.0.1'
の記述を加えて、
console
$ bundle update --ruby
を実行すると、Gemfile.lockが更新される
Gemfile.lock
RUBY VERSION
ruby 3.0.1p64
もう一度、Herokuにデプロイ
-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/ruby
-----> Ruby app detected
-----> Installing bundler 2.2.16
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-3.0.1
無事、 3.0.1
になりました。