1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Railsチュートリアルのherokuにデプロイ(git push heroku master)でremote rejectedってなった時

Last updated at Posted at 2019-02-02

Railsチュートリアルの1.5.2章

エラーメッセージ

❯ git push heroku master
Enumerating objects: 94, done.
Counting objects: 100% (94/94), done.
Delta compression using up to 4 threads.
Compressing objects: 100% (77/77), done.
Writing objects: 100% (94/94), 20.94 KiB | 765.00 KiB/s, done.
Total 94 (delta 6), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote:  !     Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
remote:                         Detected buildpacks: Ruby,Node.js
remote:                         See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote:
remote:  !
remote:  !     You must use Bundler 2 or greater with this lockfile.
remote:  !

〜〜〜〜 省略 〜〜〜〜

 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/アプリ名.git'

解決方法

❯ bundle version
Bundler version 2.0.1 (2019-01-04 commit d7ad2192f)

❯ gem uninstall bundler -v 2.0.1
Successfully uninstalled bundler-2.0.1

❯ rm -f Gemfile.lock

❯ bundle install

❯ git add Gemfile.lock

❯ git add commit

❯ git push

❯ git push heroku master  # 成功
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?