ponpokoTOYOTA
@ponpokoTOYOTA

Are you sure you want to delete the question?

Leaving a resolved question undeleted may help others!

herokuにpushできない

Q&A

Closed

解決したいこと

heroku に push できない

ディレクトリ構成

app/
 ├ CSS/
 ├ img/
 ├ JS/
 ├ .htaccess
 ├ .htpassword
 ├ index.html
 ├ index.php
 └ package.jason

 
表示するのはindex.htmlのみ
index.phpとpackage.jasonはアプリとして認識させるため

index.php
<?php include_once("index.html");
package.json
{}

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

git push heroku mainを実行したところ、
Building source:でスタックし、

remote: Building source:
remote:  !
remote:  !   Build timed out while waiting to start.
remote:  !
remote: Verifying deploy....
remote:
remote: !       Push rejected to (appname).
remote:
To https://git.heroku.com/appname.git
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/(appname).git'

とエラー文が出ました。
よく分からないままに再度pushを実行し、

remote: Building source:
remote:  !
remote:  !   Build timed out while waiting to start.
remote:  !
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: (version)
remote:  !
remote:  ! We have detected that you have triggered a build from source code with (version)
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
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy....
remote:
remote: !       Push rejected to appname.
remote:
To https://git.heroku.com/(appname).git
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/(appname).git'

既に同じバージョンが送られている、といった旨でしょうか。
このようなエラーが出たのですが、heroku openを実行しても
「Heroku | Welcome to your new app!」
という表示がされます。

原因・解消法ご存知の方おられましたらご教示いただけると嬉しいです。
よろしくお願い致します。

0

1Answer

エラー内容「error: failed to push some refs to」で調べられましたでしょうか?

リモートリポジトリのほうが新しかったりすると出るエラーのようです。
これらの記事の手順で改善されないでしょうか?

0Like

Your answer might help someone💌