LoginSignup
1
0

More than 3 years have passed since last update.

Railsチュートリアルのherokuへのpushエラーの対処法(悪い例)自分用メモ

Last updated at Posted at 2021-02-19

※この記事に書いてある解決方法は誤りです。

正確な解決方法はこちらをご覧ください。
@jnchitoさんの記事: リンク
(ご指摘いただいた@jnchitoさん本当にありがとうございます!)

以下の内容は自分の戒めのために残しておきます。

3.1 セットアップ

herokuにデプロイする際に以下のエラーが発生。

remote:  !
remote:  !     The Ruby version you are trying to install does not exist on this stack.
remote:  !     
remote:  !     You are trying to install ruby-2.6.3 on heroku-20.
remote:  !     
remote:  !     Ruby ruby-2.6.3 is present on the following stacks:
remote:  !     
remote:  !     - cedar-14
remote:  !     - heroku-16
remote:  !     - heroku-18
remote:  !     
remote:  !     Heroku recommends you use the latest supported Ruby version listed here:
remote:  !     https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
remote:  !     
remote:  !     For more information on syntax for declaring a Ruby version see:
remote:  !     https://devcenter.heroku.com/articles/ruby-versions
remote:  !

対処法

どうやらherokuのバージョンをダウンさせないといけないようです。
以下の入力で対処しました。

$ heroku stack:set heroku-18
Setting stack to heroku-18... done


その後もう一度デプロイするとさらに以下のエラーが発生。


remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !

bundle installが必要なよう。
なので以下をさらに入力

 $ bundle install --without production

すると、さらにエラー発生


You have requested:
  listen = 3.1.5

The bundle currently has listen locked at 3.4.1.
Try running `bundle update listen`

If you are updating multiple gems in your Gemfile at once,
try passing them all to `bundle update`


そこで、再度bundle installを入力後にもう一度install

$ bundle update
$ bundle install --without production

これで何とかデプロイできました。

しかしながら、この方法は間違っているとご指摘いただきました。
正しい手法はこの記事上部のリンクを踏んでください。

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