Yukimarupie / pomo

ポモドーロアプリ
0 stars 0 forks source link

Herokuのデプロイに失敗。Failed to install gems via Bundlerが出る時の対処法 #1

Closed Yukimarupie closed 3 years ago

Yukimarupie commented 3 years ago
remote: -----> Build succeeded!
remote:  !     This app may not specify any way to start a node process
remote:        https://devcenter.heroku.com/articles/nodejs-support#default-web-process-type
remote:
remote: -----> 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-3.0.1
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-19"] 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-19"] 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: 8120b26e39f943df6a28489fdcfbb070c5b82330
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version 8120b26e39f943df6a28489fdcfbb070c5b82330
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.

これが出る。

Yukimarupie commented 3 years ago

それまでにやったこと

bundle installコマンドを実行

https://devcenter.heroku.com/ja/articles/using-multiple-buildpacks-for-an-app 上記記事を参考に、node.jsなどの設定

上記2つをやってもエラーが変わらなかった

Yukimarupie commented 3 years ago

Gemfile.lockを確認

bundler (>= 1.15.0)

ローカルのbundlerのバージョンを確認

% bundle -v
Bundler version 2.2.17

herokuのstackを確認

% heroku stack
% heroku stack
=== ⬢ pomodnair Available Stacks
  container
  heroku-18
* heroku-20
Yukimarupie commented 3 years ago

下記コマンドを実行したが変わらず

 2244  gem install bundler --version '2.2.16'
 2245  bundler -v
 2246  gem list bundler
 2247  rm Gemfile.lock
 2248  bundle _2.2.16_ install
 2249  bundle _2.2.16_ install --without production
 2250  git push heroku master
Yukimarupie commented 3 years ago

https://yumishin.com/heroku-push-error/

このバージョンで指定したらできた。