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

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

新規登録して質問してみよう
ただいま回答率
85.50%
Windows 10

Windows 10は、マイクロソフト社がリリースしたOSです。Modern UIを標準画面にした8.1から、10では再びデスクトップ主体に戻され、UIも変更されています。PCやスマホ、タブレットなど様々なデバイスに幅広く対応していることが特徴です。

Git

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

Heroku

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

HTML

HTMLとは、ウェブ上の文書を記述・作成するためのマークアップ言語のことです。文章の中に記述することで、文書の論理構造などを設定することができます。ハイパーリンクを設定できるハイパーテキストであり、画像・リスト・表などのデータファイルをリンクする情報に結びつけて情報を整理します。現在あるネットワーク上のほとんどのウェブページはHTMLで作成されています。

Q&A

解決済

1回答

1461閲覧

Herokuでhello worldを表示させる

Flan.

総合スコア123

Windows 10

Windows 10は、マイクロソフト社がリリースしたOSです。Modern UIを標準画面にした8.1から、10では再びデスクトップ主体に戻され、UIも変更されています。PCやスマホ、タブレットなど様々なデバイスに幅広く対応していることが特徴です。

Git

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

Heroku

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

HTML

HTMLとは、ウェブ上の文書を記述・作成するためのマークアップ言語のことです。文章の中に記述することで、文書の論理構造などを設定することができます。ハイパーリンクを設定できるハイパーテキストであり、画像・リスト・表などのデータファイルをリンクする情報に結びつけて情報を整理します。現在あるネットワーク上のほとんどのウェブページはHTMLで作成されています。

0グッド

0クリップ

投稿2021/10/31 08:56

Enumerating objects: 3, done. Counting objects: 100% (3/3), done. Delta compression using up to 24 threads Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 328 bytes | 328.00 KiB/s, done. Total 3 (delta 0), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Building on the Heroku-20 stack remote: -----> Determining which buildpack to use for this app remote: ! No default language could be detected for this app. remote: HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically. remote: See https://xxxxxxxxxxxxxxxxx remote: remote: ! Push failed remote: ! remote: ! ## Warning - The same version of this code has already been built: 7389bd3692667287c63ea51354ae50385f042bed 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/xxxxxxxxxxxxxxxxxxxxx remote: remote: Verifying deploy... remote: remote: ! Push rejected to shrouded-river-77898. remote: To https://git.heroku.com/shrouded-river-77898.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/xxxxxxxxxxxxxxx'

heroku側のログではこのように

-----> Building on the Heroku-20 stack -----> Determining which buildpack to use for this app ! No default language could be detected for this app. HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically. See https://devcenter.heroku.com/articles/buildpacks ! Push failed

Herokuで試しにhello worldを表示させようとデプロイしようとたらなぞのエラーが出てきました
このエラーの意味がわかりません これはどういう状態ですか?
エラーの原因(できれば解決方法も)がわかる人教えてください

やったこと準
herokuにログイン
cd test
git init
git add .
git commit
heroku create
git push heroku master
(ここでエラーが出た)

os win10
デプロイしようとしてるもの hello worldを表示させるようにしたindex.htmlのみ 

気になる事 herokuでは複数アプリケーションを作れますがgit push heroku masterでどうやって
どのアプリにデプロイするのかを指定してるのかがわかりません (エラーに関係あるかも?と思ったので書いておきました )

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

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

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

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

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

guest

回答1

0

ベストアンサー

herokuにHello Worldを表示しようとしても、index.htmlだけでは表示できません。
htmlだけを上げてもherokuは「これをどうすれば良いんだ・・・?」と言う状況なので、このエラーが出るようです。

PHP+WEBサーバー(nginx、apach)やnode.jsといったサーバーサイドを使い「http~/index.htmlにアクセスしたらindex.htmlを表示させる」と言った命令が必要です。
こちらでherokuで使えるサーバーサイドのプログラミング言語を確認できます。Getting Started on Heroku

git push heroku masterで複数のherokuアプリの中で望んでいるアプリのpushされるのは、git initで作られた.gitフォルダに「このherokuとは、このherokuのリモートリポジトリを指すよ。」というファイルが保存されているからだと思います。
git remote -vでそのフォルダのリモートリポジトリの一覧が確認できます。

投稿2021/10/31 11:23

編集2021/10/31 12:31
tuna-kan

総合スコア23

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問