LoginSignup
meb4427
@meb4427 (えば)

Are you sure you want to delete the question?

Leaving a resolved question undeleted may help others!

【rails】Herokuへのデプロイ時にエラーが生じた。

Herokuへのデプロイ時のエラーを解消したい。

現在,Railsチュートリアルを参考に,webアプリケーションを作成したく,作業に取り掛かっていますが,Herokuにデプロイをする際,エラーが生じてしまい,ご助言をいただきたいと思います。

発生している問題・エラー

-----> 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.33
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-3.0.3
-----> Installing dependencies using bundler 2.2.33
       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

私は,このエラーメッセージの中で,下記の記載に着目しました。

       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.

"あなたのbundleで対応しているプラットフォームが"x86_64-darwin-19"しかないので,bundle lock --add-platform x86_64-linuxをターミナル上で実行した上で,再度試してください。"

というメッセージであると認識しております。
しかしながら,bundle lock --add-platform x86_64-linuxを実行しても,このエラーメッセージに変更はありません。
この際,どのように対応すればよろしいでしょうか。
ご助言いただけますと幸いです。

0

1Answer

自己解決いたしました。
gitでaddされていない変更があったようでして,それをadd,commit,pushした後で,git push heroku masterで無事にデプロイできました。
失礼いたしました。

0

Your answer might help someone💌