LoginSignup
6
4

More than 3 years have passed since last update.

【Rails】Herokuのエラー「The Ruby version you are trying to install does not exist on this stack.」を解決する

Last updated at Posted at 2021-02-19

課題

Rubyバージョン2.6.5で開発したアプリがHerokuのstack20ではデプロイできないスクリーンショット 2021-02-19 13.31.42.png

仮説

エラーメッセージにもあるようにHerokuのstackを18に変更すれば解決できるのでは?

1. Herokuにログインする
Terminal
$ heroku login
2. stackを18に変更してみる
Terminal
$ heroku stack:set heroku-18

 ›   Warning: heroku update available from 7.47.4 to 7.47.13.
 ›   Error: Missing required flag:
 ›     -a, --app APP  app to run command against
 ›   See more help with --help

しかしエラーが2つ出てしまった。。
【エラー①】Warning: heroku update available from 7.47.4 to 7.47.13.
【エラー②】Error: Missing required flag:

3. エラー①の対処法(Herokuのアップデート)
Terminal
$ heroku update

heroku: Updating CLI from 7.47.4 to 7.47.13... done
heroku: Updating CLI... done
Updating completions... done
4. エラー②の対処法
Terminal
$ heroku stack:set heroku-18 --app [Herokuのapp名]

Setting stack to heroku-18... done

これでHerokuのstackを18にすることができました!!
この手順で掲題のエラーは解決することができました!!

6
4
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4