LoginSignup
26
21

More than 5 years have passed since last update.

heroku git push heroku masterが拒まれた話

Posted at

herokuを使ってデプロイ

herokuを使ってデプロイをしようとしたところ

$git push heroku master


remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to muji-app-copy.
remote: 
To https://git.heroku.com/****.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/***.git'
***noMacBook-Pro:*** ***$ bundle install
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Using rake 12.3.2

との事、、、

調べると以下を実行すれば通るとの事だが

$ bundle install --without production
$ git commit -a -m "Update gemfile.lock for heroku"
$ heroku create
$ git push heroku master```

remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to muji-app-copy.
remote: 
To https://git.heroku.com/****.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/***.git'
***noMacBook-Pro:*** ***$ bundle install
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Using rake 12.3.2

しかし結果は変わらず、、、

エラー文を見てみると

Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java.

とのメッセージが

$ bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java
$ git commit -a -m "change gemfile.lock for heroku"
$ heroku create
$ git push heroku master

を実行してみると、、、通った!!

まとめ

$ heroku logs

などをしてエラーメッセージ、ログをしっかり読む!!

追記

$ rake assets:precompile

も役立つ!!

26
21
0

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
26
21