1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

herokuにデプロイする際に' The Ruby version you are trying to install does not exist on this stack. 'という警告が出る問題の対処法

Last updated at Posted at 2021-03-05

概要

Railsでアプリケーションを作成し、リモートリポジトリのherokuにpushした際に、下記の警告メッセージが表示され、pushに失敗してしまうというのが今回の大まかな概要になります。

The Ruby version you are trying to install does not exist on this stack.
You are trying to install ruby-2.6.5 on heroku-20.
Ruby ruby-2.6.5 is present on the following stacks:
cedar-14, heroku-16, heroku-18

この警告は訳すと、「あなたはRubyのバージョン2.6.5をheroku-20スタックでinstallしようとしています」ってことですね。

要するに、heroku側のスタックと、実際に利用しているRubyのバージョンがミスマッチしているが故に発生している警告です。

解決策

警告メッセージによるとheroku-20では、Rubyのバージョン2.6.5はフォローされておらず、Rubyのバージョン2.6.5はcedar-14, heroku-16, heroku-18のスタック上でフォローされているということがわかります。

なので、下記のコマンドで

 heroku stack:set <stackname>

でherokuのスタックを変更すると、herokuにpushできるようになります。

1
0
0

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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?