##git push heroku master時、以下のメッセージ文が出たら...
-----> Ruby app detected
remote: -----> Installing bundler 2.2.16
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.6.5
remote: -----> Installing dependencies using bundler 2.2.16
remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
remote: Your bundle only supports platforms ["x86_64-darwin-20"] but your local platform
remote: is x86_64-linux. Add the current platform to the lockfile with `bundle lock
remote: --add-platform x86_64-linux` and try again.
remote: Bundler Output: Your bundle only supports platforms ["x86_64-darwin-20"] but your local platform
remote: is x86_64-linux. Add the current platform to the lockfile with `bundle lock
remote: --add-platform x86_64-linux` and try again.
remote:
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: f61987a525962d5489c36028ef399a68c6f1686f
remote: !
remote: ! We have detected that you have triggered a build from source code with version f61987a525962d5489c36028ef399a68c6f1686f
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
重要なとことは、以下の文。
Your bundle only supports platforms ["x86_64-darwin-20"] but your local platform
remote:is x86_64-linux.
##解決したコマンド
以下の文を打てば、解決
% bundle lock --add-platform x86_64-linux #このコマンドは何回か弾かれたから、コンソールをコピーして
% git add .
% git commit -m 'Add platform'