Hiratto / hiratto-blogapp

0 stars 0 forks source link

Herokuデプロイ時のエラー #42

Open Hiratto opened 2 years ago

Hiratto commented 2 years ago

-----> Building on the Heroku-20 stack -----> Determining which buildpack to use for this app ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used. Detected buildpacks: Ruby,Node.js See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order -----> Ruby app detected -----> Installing bundler 2.2.21 -----> Removing BUNDLED WITH version in the Gemfile.lock -----> Compiling Ruby/Rails Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-20/ruby-2.6.5.tgz -s -o - | tar zxf - ' failed on attempt 1 of 3. Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-20/ruby-2.6.5.tgz -s -o - | tar zxf - ' failed on attempt 2 of 3. ! ! 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: !
! - heroku-18 !
! Heroku recommends you use the latest supported Ruby version listed here: ! https://devcenter.heroku.com/articles/ruby-support#supported-runtimes !
! For more information on syntax for declaring a Ruby version see: ! https://devcenter.heroku.com/articles/ruby-versions ! ! Push rejected, failed to compile Ruby app. ! Push failed

======================

-----> Heroku-20スタックでの構築 -----> このアプリに使用するビルドパックの決定 ! 警告です。複数のデフォルトビルドパックが、このアプリを処理する能力を報告しています。以下のリストの最初のビルドパックが使用されます。 検出されたビルドパック Ruby,Node.js https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order を参照してください。 -----> Ruby app detected -----> bundler 2.2.21のインストール -----> Gemfile.lock で BUNDLED WITH バージョンを削除する。 -----> Ruby/Railsをコンパイルする コマンドで 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-20/ruby-2.6.5.tgz -s -o - | tar zxf - ' 3回中1回目の試行で失敗しました。 コマンドです。'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-20/ruby-2.6.5.tgz -s -o - | tar zxf - ' 3回のうち2回目の試行で失敗しました。 ! ! インストールしようとしているRubyのバージョンは、このスタックには存在しません。 !
! ruby-2.6.5 を heroku-20 にインストールしようとしています。 !
! Ruby ruby-2.6.5 は以下のスタックに存在します。 !
! - heroku-18 !
! Herokuでは、ここに記載されている最新のサポートされているRubyバージョンを使用することをお勧めします。 ! https://devcenter.heroku.com/articles/ruby-support#supported-runtimes !
! Rubyのバージョンを宣言するための構文については、以下を参照してください。 ! https://devcenter.heroku.com/articles/ruby-versions ! ! Push rejected, failed to compile Ruby app. ! プッシュ失敗

Hiratto commented 2 years ago

Herokuの20から18に変更 >Herokuへのログイン時にエラー >こちらで解決(https://blog.tanebox.com/archives/630/

Hiratto commented 2 years ago

その後もう一度Herokuへデプロイ >以下のエラー発生

-----> Building on the Heroku-18 stack -----> Determining which buildpack to use for this app ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used. Detected buildpacks: Ruby,Node.js See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order -----> Ruby app detected -----> Installing bundler 2.2.21 -----> Removing BUNDLED WITH version in the Gemfile.lock -----> Compiling Ruby/Rails -----> Using Ruby version: ruby-2.6.5 -----> Installing dependencies using bundler 2.2.21 Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4 Your bundle only supports platforms ["x86_64-darwin-19"] but your local platform is x86_64-linux. Add the current platform to the lockfile with bundle lock --add-platform x86_64-linux and try again. Bundler Output: Your bundle only supports platforms ["x86_64-darwin-19"] but your local platform is x86_64-linux. Add the current platform to the lockfile with bundle lock --add-platform x86_64-linux and try again. ! ! Failed to install gems via Bundler. ! ! Push rejected, failed to compile Ruby app. ! Push failed

======================

-----> Heroku-18スタックでの構築 -----> このアプリに使用するビルドパックの決定 ! 警告です。複数のデフォルトビルドパックが、このアプリを処理する能力を報告しています。以下のリストの最初のビルドパックが使用されます。 検出されたビルドパック Ruby,Node.js https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order を参照してください。 -----> Ruby app detected -----> bundler 2.2.21のインストール -----> Gemfile.lock で BUNDLED WITH バージョンを削除する。 -----> Ruby/Rails をコンパイルする -----> Using Ruby version: ruby-2.6.5 -----> bundler 2.2.21 を使った依存関係のインストール 実行中です。BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4 バンドルはプラットフォーム["x86_64-darwin-19"]のみをサポートしていますが、あなたのローカルプラットフォームは はx86_64-linuxです。現在のプラットフォームをロックファイルに追加するには、bundle lock --add-platform x86_64-linuxでロックファイルに現在のプラットフォームを追加して、もう一度試してみてください。 バンドルの出力です。バンドルはプラットフォーム["x86_64-darwin-19"]しかサポートしていませんが、あなたのローカルプラットフォームは は x86_64-linux です。現在のプラットフォームをロックファイルに追加するには、bundle lock --add-platform x86_64-linuxでロックファイルに現在のプラットフォームを追加して、もう一度試してみてください。 ! ! Bundler経由でのgemsのインストールに失敗しました。 ! ! プッシュが拒否され、Rubyアプリのコンパイルに失敗しました。 ! プッシュ失敗

Hiratto commented 2 years ago

>Herokuでデプロイに失敗するときの対処法(Ruby app detected されない問題) https://qiita.com/yuki_0920/items/b1065777edf090351052 でデプロイ作業可能に

Hiratto commented 2 years ago

新たなエラー

Build succeeded! ! Unmet dependencies don't fail yarn install but may cause runtime issues https://github.com/npm/npm/issues/7494 -----> Ruby app detected -----> Installing bundler 2.2.21 -----> Removing BUNDLED WITH version in the Gemfile.lock -----> Compiling Ruby/Rails -----> Using Ruby version: ruby-2.6.5 -----> Installing dependencies using bundler 2.2.21 Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4 Your bundle only supports platforms ["x86_64-darwin-19"] but your local platform is x86_64-linux. Add the current platform to the lockfile with bundle lock --add-platform x86_64-linux and try again. Bundler Output: Your bundle only supports platforms ["x86_64-darwin-19"] but your local platform is x86_64-linux. Add the current platform to the lockfile with bundle lock --add-platform x86_64-linux and try again. ! ! Failed to install gems via Bundler. ! ! Push rejected, failed to compile Ruby app. ! Push failed

======================

ビルド成功!? ! 依存関係が満たされていない場合、ヤーンのインストールには失敗しませんが、ランタイムの問題が発生する可能性があります。 https://github.com/npm/npm/issues/7494 -----> Rubyアプリの検出 -----> bundler 2.2.21 のインストール -----> Gemfile.lock で BUNDLED WITH バージョンを削除する。 -----> Ruby/Rails をコンパイルする -----> Using Ruby version: ruby-2.6.5 -----> bundler 2.2.21 を使った依存関係のインストール 実行中です。BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4 バンドルはプラットフォーム["x86_64-darwin-19"]のみをサポートしていますが、あなたのローカルプラットフォームは はx86_64-linuxです。現在のプラットフォームをロックファイルに追加するには、bundle lock --add-platform x86_64-linuxでロックファイルに現在のプラットフォームを追加して、もう一度試してみてください。 バンドルの出力です。バンドルはプラットフォーム["x86_64-darwin-19"]しかサポートしていませんが、あなたのローカルプラットフォームは は x86_64-linux です。現在のプラットフォームをロックファイルに追加するには、bundle lock --add-platform x86_64-linuxでロックファイルに現在のプラットフォームを追加して、もう一度試してみてください。 ! ! Bundler経由でのgemsのインストールに失敗しました。 ! ! プッシュが拒否され、Rubyアプリのコンパイルに失敗しました。 ! プッシュ失敗

Hiratto commented 2 years ago

【Rails6】herokuデプロイエラー時の対処 https://qiita.com/ShutoToyama/items/05e50418057775059e70

【2019年7月最新】Rails Herokuデプロイ時のbundlerエラー解決方法 [かなりハマった...] https://310nae.com/heroku-bundler/

>Bundlerのバージョン変更 >$ bundle lock --add-platform x86_64-linuxの実行 >Gemfile.lockの内容変更

Hiratto commented 2 years ago

デプロイ成功!