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

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

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

Cloud9は、クラウドからのプログラミングが可能になるWebサービス。IDEとしての機能が搭載されており、GitHubやHerokuなど他ツールとの連携も可能です。ブラウザ上で動くため、デバイスに関係なく開発環境を準備できます。

Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Heroku

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

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

Q&A

解決済

1回答

795閲覧

herokuへデプロイできない(Railsチュートリアル1章にて)

babi-0105

総合スコア10

Cloud9

Cloud9は、クラウドからのプログラミングが可能になるWebサービス。IDEとしての機能が搭載されており、GitHubやHerokuなど他ツールとの連携も可能です。ブラウザ上で動くため、デバイスに関係なく開発環境を準備できます。

Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Heroku

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

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

0グッド

0クリップ

投稿2019/12/31 06:14

編集2020/01/03 07:52

#前提・実現したいこと
AWScloud9からherokuへのデプロイを行いたいです。
#発生している問題・エラーメッセージ
Railsチュートリアル1章の通りに進めていたつもりなのですが、
$heroku createで生成したURL(2つあるURLのうちの最初に記載されているURL)へ移行した際、『bye!』などの(ローカル環境で表示できた)、メッセージ表示したいのですが以下のようなものになってしまいます。
![イメージ説明

#該当のソースコード

ec2-user:~/environment (modify-README) $ heroku create Creating app... done, ⬢ thawing-island-51898 https://thawing-island-51898.herokuapp.com/ | https://git.heroku.com/thawing-island-51898.git

#自分で調べたことや試したこと
リンク内容
の記事を参考に$ heroku logs | grep error で確認したところ

at=error code=H14 desc="No web processes running"

との事です

リンク内容
を参考に進めたところ
エラーは解決せず立ち止まってしまいました

⬇️以下は参考になるか分からないですが、行った事です。

$ git push fatal: The current branch modify-README has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin modify-README
$ bundle install --without production The Gemfile specifies no dependencies Bundle complete! 0 Gemfile dependencies, 1 gem now installed. Gems in the groups production, development and test were not installed. Use `bundle info [gemname]` to see where a bundled gem is installed. ec2-user:~/environment (modify-README) $ git commit -a -m "Update Gemfile for Heroku" [modify-README b30f6a4] Update Gemfile for Heroku 1 file changed, 4 insertions(+)
$ heroku --version heroku/7.35.1 linux-x64 node-v12.13.0

その後、Herokuへログイン完了は完了

$heroku run rails console Running rails console on ⬢ obscure-ocean-41599... up, run.8355 (Free) bash: rails: command not found
$ heroku stack:set container Stack set. Next release on ⬢ obscure-ocean-41599 will use container. Run git push heroku master to create a new release on ⬢ obscure-ocean-41599. ec2-user:~/environment (modify-README) $ git push heroku master Everything up-to-date ec2-user:~/environment (modify-README) $ heroku ps:scale web=1 Scaling dynos... ! ▸ Couldn't find that process type (web).

#補足情報
・開発環境:AWS Cloud9
・データベース:sqlite3 version3.7.17
・ブラウザ:GoogleChrome
・Rails 6.0.2.1

情報が少なくてすみません。
追記すべき情報などございましたら、言っていただきたいと思います。
回答お待ちしております。

#追記①
$ git remote -v と $ git push heroku masterを行ったところ

$heroku createのURLでは同じく表示したいものが表示されませんでした。

『does not have access to boiling-falls-6570.』と。
僕のアカウントではアクセスできないとの事です。

ググったところ僕と同じエラーでの解決はみられなかったのですが、以下を参考にしました。
リンク内容
しかし、解決せずです。

ec2-user:~/environment/hello_app (modify-README) $ git remote -v heroku https://git.heroku.com/boiling-falls-6570.git (fetch) heroku https://git.heroku.com/boiling-falls-6570.git (push) origin git@bitbucket.org:(ここはユーザー名です)/toy_app.git (fetch) origin git@bitbucket.org:(ここはユーザー名です)/toy_app.git (push) ec2-user:~/environment/hello_app (modify-README) $ git push heroku master remote: ! Your account (メールアドレスです) does not have access to boiling-falls-6570. fatal: unable to access 'https://git.heroku.com/boiling-falls-6570.git/': The requested URL returned error: 403

#追記②
記載されたurl(https://dashboard.heroku.com/apps/thawing-island-51898/deploy/heroku-git)の通り進めていったのですが、動かずです。。

コンソール結果は以下の通りです。

ec2-user:~/environment (modify-README) $ cd ~/environment/hello_app/ ec2-user:~/environment/hello_app (modify-README) $ source <(curl -sL https://cdn.learnenough.com/heroku_install) % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 25.9M 100 25.9M 0 0 52.2M 0 --:--:-- --:--:-- --:--:-- 52.2M mv: cannot move ‘heroku’ to ‘/usr/local/heroku’: Directory not empty ec2-user:~/environment/hello_app (modify-README) $ heroku login heroku: Press any key to open up the browser to login or q to exit: › Error: quit ec2-user:~/environment/hello_app (modify-README) $ heroku login --interactive heroku: Enter your login credentials Email [epifa_kikka@icloud.com]: Password: ********* Logged in as (メールアドレス) ec2-user:~/environment/hello_app (modify-README) $ cd my-project/ bash: cd: my-project/: No such file or directory ec2-user:~/environment/hello_app (modify-README) $ git init Reinitialized existing Git repository in /home/ec2-user/environment/hello_app/.git/ ec2-user:~/environment/hello_app (modify-README) $ heroku git:remote -a thawing-island-51898 set git remote heroku to https://git.heroku.com/thawing-island-51898.git ec2-user:~/environment/hello_app (modify-README) $ git add . ec2-user:~/environment/hello_app (modify-README) $ git commit -am "make it better" [modify-README a5f6bad] make it better 3 files changed, 11 insertions(+), 22 deletions(-) ec2-user:~/environment/hello_app (modify-README) $ git push heroku master Counting objects: 13633, done. Compressing objects: 100% (12359/12359), done. Writing objects: 100% (13633/13633), 24.29 MiB | 3.25 MiB/s, done. Total 13633 (delta 5265), 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 1 … 一部省略 … remote: ###### WARNING: remote: remote: You have not declared a Ruby version in your Gemfile. remote: To set your Ruby version add this line to your Gemfile: remote: ruby '2.5.7' remote: # See https://devcenter.heroku.com/articles/ruby-versions for more information. remote: remote: remote: ###### WARNING: remote: remote: Replacing libpq with version libpq 5.12.1 remote: remote: This version includes a bug fix that can cause an exception remote: on boot for applications with incorrectly configured connection remote: values. For more information see: remote: remote: https://devcenter.heroku.com/articles/libpq-5-12-1-breaking-connection-behavior remote: remote: If your application breaks you can rollback to your last build. remote: You can also temporarially opt out of this behavior by setting: remote: remote: ``` remote: $ heroku config:set HEROKU_SKIP_LIBPQ12=1 remote: ``` remote: remote: In the future libpq 5.12 will be the default on the platform an remote: you will not be able to opt-out of the library. For more information see: remote: remote: https://devcenter.heroku.com/articles/libpq-5-12-1-breaking-connection-behavior remote: remote: remote: ###### WARNING: remote: remote: Detecting rails configuration failed remote: set HEROKU_DEBUG_RAILS_RUNNER=1 to debug remote: remote: remote: ###### WARNING: remote: remote: No Procfile detected, using the default web server. remote: We recommend explicitly declaring how to boot your server process via a Procfile. remote: https://devcenter.heroku.com/articles/ruby-default-web-server remote: remote: remote: remote: -----> Discovering process types remote: Procfile declares types -> (none) remote: Default types for buildpack -> console, rake, web remote: remote: -----> Compressing... remote: Done: 59.9M remote: -----> Launching... remote: Released v4 remote: https://thawing-island-51898.herokuapp.com/ deployed to Heroku remote: remote: Verifying deploy... done. To https://git.heroku.com/thawing-island-51898.git * [new branch] master -> master ec2-user:~/environment/hello_app (modify-README) $ heroku git:remote -a thawing-island-51898 set git remote heroku to https://git.heroku.com/thawing-island-51898.git ec2-user:~/environment/hello_app (modify-README) $ heroku logs --tail › Error: Multiple apps in git remotes › Usage: --remote heroku-staging › or: --app boiling-falls-6570 › Your local git repository has more than 1 app referenced in git › remotes. › Because of this, we can't determine which app you want to run this › command against. › Specify the app you want with --app or --remote. › Heroku remotes in repo: › thawing-island-51898 (heroku) › boiling-falls-6570 (heroku-staging) › › https://devcenter.heroku.com/articles/multiple-environments

【結果】
リンク内容を開いた結果
イメージ説明
が表示されました。

このエラーで検索した結果たどり着いた記事(リンク内容)を参考に進めたのですが、解決せずです。。

$ heroku run rails console

した際の結果がこちらです。

› Error: Multiple apps in git remotes › Usage: --remote heroku-staging › or: --app boiling-falls-6570 › Your local git repository has more than 1 app referenced in git › remotes. › Because of this, we can't determine which app you want to run this › command against. › Specify the app you want with --app or --remote. › Heroku remotes in repo: › thawing-island-51898 (heroku) › boiling-falls-6570 (heroku-staging) › › https://devcenter.heroku.com/articles/multiple-environments

情報が少ないかもしれないですが、追記の必要があればいっていただきたいです。
お願いします。

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

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

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

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

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

gouf

2019/12/31 07:36

heroku create した段階では、手元のアプリケーションはまだ何も転送されていない状態だと思います。「git remote -v」で確認してみると heroku アプリのデプロイ先が追記されているはずです 「git push heroku master」を実行した場合になにか変化は見られますか?
babi-0105

2019/12/31 08:33

変化は見られないみたいです。。 追記内容を記載しました。 お忙しいとは思いますが、確認いただきたいです。
guest

回答1

0

ベストアンサー

チュートリアルの通りにやってませんね。
見落とし、読み飛ばし、手抜き、自己流、勘違いあたりかな。

チュートリアルの質問が多いので少しやってみました。チュートリアル程度なら目をつむったってできるさ、と思ってたのですが、Herokuからみで行き詰まってやむを得ず rails new からやり直し、というのを何回か経験しました。
ということで提案
rails newに戻ってチュートリアルの通りにやってみる。それでできたらいまの失敗のと比べてどこが悪かったのかを覚える。
Heroku固有のknow howかもしれませんが

投稿2020/01/05 07:42

winterboum

総合スコア23284

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

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

babi-0105

2020/01/05 07:50

回答ありがとうございます! そうですね。もう一度やり直してみます!!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問