質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

Q&A

1回答

711閲覧

git push時にerror: failed to push some refs toとエラーがでる

nikoniko3

総合スコア5

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

0グッド

0クリップ

投稿2020/11/10 13:03

herokuを使ってPythonアプリをHerokuにデプロイしようとしています。
git push時にerror: failed to push some refs toとエラーがでます。
名前→ユーザーで表記

(env) C:\Users\ユーザー\djangogirls\instant-django-master>heroku login
heroku: Press any key to open up the browser to login or q to exit:
Opening browser to https://cli-auth.heroku.com/auth/cli/browser/d6179a75-edbe-4bd1-aca7-d5fd34568ef2?requestor=SFMyNTY.g3QAAAACZAAEZGF0YW0AAAANMTQuMTIuMTMwLjIyNGQABnNpZ25lZG4GAFSjKrJ1AQ.FO4n3LUyHdT2aBwqjMBZMXaQTp4HQ01LeAc7Fh9sH4s
Logging in... done
Logged in as メールアドレス

(env) C:\Users\ユーザー\djangogirls\instant-django-master>heroku create
Creating app... done, ⬢ lit-springs-88054
https://lit-springs-88054.herokuapp.com/ | https://git.heroku.com/lit-springs-88054.git

(env) C:\Users\ユーザー\djangogirls\instant-django-master>git init
Reinitialized existing Git repository in C:/Users/test/djangogirls/instant-django-master/.git/

(env) C:\Users\ユーザー\djangogirls\instant-django-master>heroku git:remote -a medipolis-keika
set git remote heroku to https://git.heroku.com/medipolis-keika.git

(env) C:\Users\ユーザー\djangogirls\instant-django-master>git add .git push heroku master
fatal: pathspec 'push' did not match any files

(env) C:\Users\ユーザー\djangogirls\instant-django-master>git push heroku master
Enumerating objects: 55, done.
Counting objects: 100% (55/55), done.
Delta compression using up to 4 threads
Compressing objects: 100% (45/45), done.
Writing objects: 100% (55/55), 20.67 KiB | 460.00 KiB/s, done.
Total 55 (delta 6), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.9.0
remote: -----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
・・・・
・・・・
・・・・

remote: ----------------------------------------
remote: ERROR: Failed building wheel for pyodbc
remote: Running setup.py clean for pyodbc
remote: Successfully built docopt psycopg2
remote: Failed to build pyodbc
remote: Installing collected packages: asgiref, certifi, chardet, dj-database-url, pytz, Django, django-crispy-forms, django-filter, whitenoise, psycopg2, django-heroku, pyodbc, django-pyodbc-azure, docopt, gunicorn, idna, urllib3, requests, yarg, pipreqs, sqlparse
remote: Running setup.py install for pyodbc: started
remote: Running setup.py install for pyodbc: finished with status 'error'
remote: ERROR: Command errored out with exit status 1:
remote: command: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vo7fz92g/pyodbc/setup.py'"'"'; file='"'"'/tmp/pip-install-vo7fz92g/pyodbc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-8p0nkdla/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.9/pyodbc
remote: cwd: /tmp/pip-install-vo7fz92g/pyodbc/
remote: Complete output (14 lines):
remote: running install
remote: running build
remote: running build_ext
remote: building 'pyodbc' extension
remote: creating build
remote: creating build/temp.linux-x86_64-3.9
remote: creating build/temp.linux-x86_64-3.9/src
remote: gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPYODBC_VERSION=4.0.30 -I/app/.heroku/python/include/python3.9 -c src/buffer.cpp -o build/temp.linux-x86_64-3.9/src/buffer.o -Wno-write-strings
remote: In file included from src/buffer.cpp:12:0:
remote: src/pyodbc.h:56:10: fatal error: sql.h: No such file or directory
remote: #include <sql.h>
remote: ^~~~~~~
remote: compilation terminated.
remote: error: command '/usr/bin/gcc' failed with exit code 1
remote: ----------------------------------------
remote: ERROR: Command errored out with exit status 1: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vo7fz92g/pyodbc/setup.py'"'"'; file='"'"'/tmp/pip-install-vo7fz92g/pyodbc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-8p0nkdla/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.9/pyodbc Check the logs for full command output.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 982ec36d1895c28b4e2e543383743b53a54d8c86
remote: !
remote: ! We have detected that you have triggered a build from source code with version 982ec36d1895c28b4e2e543383743b53a54d8c86
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 medipolis-keika.
remote:
To https://git.heroku.com/medipolis-keika.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/medipolis-keika.git'

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

add したあとはcommitしましょう

投稿2020/11/10 13:08

y_waiwai

総合スコア87774

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

nikoniko3

2020/11/10 13:18

有難うございます。 以下のコマンドを実行しましたが、同じエラーとなります。 初心者のため、初歩的なところが理解できておりません、どうぞよろしくお願いします (env) C:\Users\ユーザー\djangogirls\instant-django-master>git add . (env) C:\Users\ユーザー\djangogirls\instant-django-master>git commit -am "コメ ント" On branch master nothing to commit, working tree clean (env) C:\Users\ユーザー\djangogirls\instant-django-master>git push heroku master
y_waiwai

2020/11/10 13:27

commit失敗してますよ
nikoniko3

2020/11/10 13:47

有難うございます。 以下のメッセージが理解できておりません。 よろしくお願い致します。 <ngogirls/instant-django-master/.git/COMMIT_EDITMSG [unix] (22:36 10/11/2020)4,1 All commit 982ec36d1895c28b4e2e543383743b53a54d8c86 (HEAD -> master) Author: ユーザー <**********@***.org> Date: Mon Nov 9 13:10:05 2020 +0900 コメント commit f3240a01c4637798a172c2e0e13010c3c5b21a5a Author: ユーザー<*****@****.org> Date: Sun Nov 8 12:57:13 2020 +0900 first commit (env) C:\Users\ユーザー\djangogirls\instant-django-master>git commit --amend hint: Waiting for your editor to close the file...
y_waiwai

2020/11/10 13:52

> hint: エディタがファイルを閉じるのを待っています... とおっしゃってます commit時にはコミットメッセージを入力する必要があります 登録エディタが開くので、なにかメッセージ入れて保存登録しましょう
nikoniko3

2020/11/10 14:04

丁寧に有難うございます。 以下のコマンドは、上手くできていないのでしょうか? (env) C:\Users\ユーザー\djangogirls\instant-django-master>git status On branch master nothing to commit, working tree clean
y_waiwai

2020/11/10 14:14

> コミットするものは何もありません。 とおっしゃってますが、 pushは成功してるんでしょうか
nikoniko3

2020/11/10 14:58

何度もすみません、おそらくpushが成功していません。 私の知識では、理解が難しく一からすみません。以下のエラーでした。 (env) C:\Users\ユーザー\djangogirls\instant-django-master>git push heroku testbranch:master error: src refspec testbranch does not match any error: failed to push some refs to 'https://git.heroku.com/medipolis-keika.git'
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問