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

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

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

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

Heroku

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

Q&A

解決済

1回答

1426閲覧

Herokuのデプロイエラーについて

qazplm8888

総合スコア2

Git

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

Heroku

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

0グッド

0クリップ

投稿2020/08/08 15:21

編集2020/08/09 07:19

https://note.com/consultant1221/n/n7084879ae345
LINEbotを作ろうと思い、上記のサイトを
参考にしながら作業をしていたのですが、
git push heroku masterを打つと
error: src refspect master dose not matchany
error: failed to push some refs to 'ssh://heroku.com/testapp.git'
と出てしまいます。色々なサイトを調べた
のですが結局このエラーがなくなりません。
どうすればよいのでしょうか?
追記
git status

On branch master

No commits yet

Changes to be committed:
(use ''git rm --cached<file>...''to unstage)
new file: Procfile
new file: main.py
new file: requirements.txt
new file: runtime.txt

git log

fatal:your current branch 'master' dose not have any commits yet

追記
git commit -am "make it better"

*** Please tell me who you are.

Run

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'masakazu@DESKTOP-D231TSH.(none)')

C:\Users\masakazu\Desktop\line-bot-test>

このような感じで出ます。。

追記
一応設定はして最初に質問したエラーはなくなったのですがこれは上手くいっているのでしょうか?
git commit -am "make it better"
[master (root-commit) 460db2b] make it better
4 files changed, 45 insertions(+)
create mode 100644 Procfile
create mode 100644 main.py
create mode 100644 requirements.txt
create mode 100644 runtime.txt

C:\Users\masakazu\Desktop\line-bot-test>git push heroku master
The authenticity of host 'heroku.com (50.19.85.156)' can't be established.
RSA key fingerprint is SHA256:8tF0wX2WquK45aGKs/Bh1dKmBXH08vxUe0VCJJWOA/o.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

追記
やったらまたエラーが出てしまいました。。
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'heroku.com,50.19.85.132' (RSA) to the list of known hosts.
Enumerating objects: 6, done.
Counting objects: 100% (6/6), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (6/6), 1.16 KiB | 39.00 KiB/s, done.
Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: ! Requested runtime (python-3.8) is not available for this stack (heroku-18).
remote: ! Aborting. More info: https://devcenter.heroku.com/articles/python-support
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to shomohin.
remote:
To ssh://heroku.com/shomohin.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh://heroku.com/shomohin.git'

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

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

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

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

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

y_shinoda

2020/08/08 15:49

git status, git log を実行した結果を、質問欄に次の記法で追記お願いします: ```console (ここに git status, git log の実行結果を記載) ```
qazplm8888

2020/08/08 15:59

git:'status,git' is not a git command.See 'git --help'.と返ってきました。
qazplm8888

2020/08/08 16:01

```console (git:'status,git' is not a git command.See 'git --help'.) 、、、
y_shinoda

2020/08/08 16:02 編集

git status と git log は別々に実行してください、 そして、結果はこちらではなく、質問欄に追記してください
guest

回答1

0

ベストアンサー

元の回答

git commit を忘れていませんか?

参考: Answer: Message 'src refspec master does not match any' when pushing commits in Git

追記

console

1$ git status 2 3On branch master 4 5No commits yet 6 7Changes to be committed: 8(use ''git rm --cached<file>...''to unstage) 9new file: Procfile 10new file: main.py 11new file: requirements.txt 12new file: runtime.txt 13 14$ git log 15 16fatal:your current branch 'master' dose not have any commits yet

上記のような状態であれば、やはり commit がなされていないことが原因です

console

1git commit -am "make it better" 2 3*** Please tell me who you are. 4 5Run 6 7git config --global user.email "you@example.com" 8git config --global user.name "Your Name" 9 10to set your account's default identity. 11Omit --global to set the identity only in this repository. 12 13fatal: unable to auto-detect email address (got 'masakazu@DESKTOP-D231TSH.(none)') 14 15C:\Users\masakazu\Desktop\line-bot-test>

上記のメッセージにある通り、
まずメールアドレスとユーザー名を設定する必要があります:

console

1git config --global user.email "you@example.com" 2git config --global user.name "Your Name"

コマンドラインでは不要なメッセージも多く表示されますが、
うまく動いていないと感じたら、メッセージを確認してみましょう
特に、Git に関しては
おかしいと思ったら git status コマンドを実行すれば
大体原因がわかります

または GUI ツールを使いましょう:

TOrtoiseGit:

VisualStudioCode:

console

1$ git commit -am "make it better" 2[master (root-commit) 460db2b] make it better 34 files changed, 45 insertions(+) 4create mode 100644 Procfile 5create mode 100644 main.py 6create mode 100644 requirements.txt 7create mode 100644 runtime.txt 8 9$ git push heroku master 10The authenticity of host 'heroku.com (50.19.85.156)' can't be established. 11RSA key fingerprint is SHA256:8tF0wX2WquK45aGKs/Bh1dKmBXH08vxUe0VCJJWOA/o. 12Are you sure you want to continue connecting (yes/no/[fingerprint])? 13Host key verification failed. 14fatal: Could not read from remote repository. 15 16Please make sure you have the correct access rights 17and the repository exists.

commit には成功していますが、push に失敗しています

次のメッセージが表示されたときに yes と入力します

console

1Are you sure you want to continue connecting (yes/no/[fingerprint])?

console

1Requested runtime (python-3.8) is not available for this stack (heroku-18)

runtime.txt には Heroku の Dyno がサポートしている Python バージョンを指定します:

text

1python-3.8.5

参考: Supported runtimes | Heroku Python Support | Heroku Dev Center

投稿2020/08/08 15:38

編集2020/08/09 07:32
y_shinoda

総合スコア3272

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

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

qazplm8888

2020/08/08 15:43

一応やったんですが変わりません でした。。 git commit -m ''inital commit'' と打ってからgit push heroku master をやったんですがダメです。。
y_shinoda

2020/08/08 16:16

回答に追記しました
y_shinoda

2020/08/08 16:36

回答に追記しました
y_shinoda

2020/08/08 17:00

回答に追記しました
y_shinoda

2020/08/09 07:32

回答に追記しました
qazplm8888

2020/08/09 07:38

無事できました(´;ω;`) ほんとに1から教えていただき ありがとうございました!! また何かで分からなくなった時に よろしければ教えていただけると ありがたいです。。 この度は本当にありがとうございました!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問