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

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

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

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

Ruby

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

Heroku

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

Ruby on Rails

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

Q&A

解決済

1回答

9382閲覧

Herokuにデプロイしたが、「Heroku | Welcome to your new app!」のメッセージが表示される

asatosi

総合スコア23

Cloud9

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

Ruby

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

Heroku

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

Ruby on Rails

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

1グッド

2クリップ

投稿2018/12/27 18:56

前提・実現したいこと

RRuby on Rails Tutorial(http://railstutorial.jp/)の第2章に書いてあるhello worldプログラムをHerokuにデプロイしたい。

発生している問題・エラーメッセージ

「Heroku | Welcome to your new app!」が表示され、表示したい「hello, world!」が表示されません。

heroku のマイページを確認すると「https://aqueous-gorge-72050.herokuapp.com/」は
掲載されているのですが、正しく表示できるページについている「ruby」の表記がついていませんでした。

### ソースコード ec2-user:~/environment/toy_app (master) $ git commit -am "Add Hello" [master e005b11] Add Hello 1 file changed, 1 insertion(+), 1 deletion(-) ec2-user:~/environment/toy_app (master) $ heroku create Creating app... done, ⬢ aqueous-gorge-72050 https://aqueous-gorge-72050.herokuapp.com/ | https://git.heroku.com/aqueous-gorge-72050.git ec2-user:~/environment/toy_app (master) $ git push heroku master Counting objects: 5, done. Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 464 bytes | 464.00 KiB/s, done. Total 5 (delta 3), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Ruby app detected remote: -----> Compiling Ruby/Rails remote: -----> Using Ruby version: ruby-2.4.5 remote: -----> Installing dependencies using bundler 1.15.2 remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.17.1). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. remote: Fetching gem metadata from https://rubygems.org/......... remote: Fetching version metadata from https://rubygems.org/.. remote: Fetching dependency metadata from https://rubygems.org/. remote: Using rake 12.3.2 remote: Using concurrent-ruby 1.1.4 remote: Using minitest 5.11.3 remote: Using thread_safe 0.3.6 remote: Using builder 3.2.3 remote: Using erubi 1.8.0 remote: Using mini_portile2 2.4.0 remote: Using crass 1.0.4 remote: Using rack 2.0.6 remote: Using nio4r 2.3.1 remote: Using websocket-extensions 0.1.3 remote: Using mini_mime 1.0.1 remote: Using arel 8.0.0 remote: Using bundler 1.15.2 remote: Using coffee-script-source 1.12.2 remote: Using execjs 2.7.0 remote: Using method_source 0.9.2 remote: Using thor 0.20.3 remote: Using ffi 1.9.25 remote: Using multi_json 1.13.1 remote: Using pg 0.20.0 remote: Using puma 3.9.1 remote: Using rb-fsevent 0.10.3 remote: Using tilt 2.0.9 remote: Using turbolinks-source 5.2.0 remote: Using i18n 1.3.0 remote: Using tzinfo 1.2.5 remote: Using nokogiri 1.9.1 remote: Using websocket-driver 0.6.5 remote: Using rack-test 1.1.0 remote: Using sprockets 3.7.2 remote: Using mail 2.7.1 remote: Using coffee-script 2.4.1 remote: Using uglifier 3.2.0 remote: Using rb-inotify 0.10.0 remote: Using turbolinks 5.0.1 remote: Using activesupport 5.1.6 remote: Using loofah 2.2.3 remote: Using sass-listen 4.0.0 remote: Using rails-dom-testing 2.0.3 remote: Using globalid 0.4.1 remote: Using activemodel 5.1.6 remote: Using jbuilder 2.7.0 remote: Using rails-html-sanitizer 1.0.4 remote: Using sass 3.7.2 remote: Using activerecord 5.1.6 remote: Using actionview 5.1.6 remote: Using activejob 5.1.6 remote: Using actionpack 5.1.6 remote: Using actioncable 5.1.6 remote: Using actionmailer 5.1.6 remote: Using railties 5.1.6 remote: Using sprockets-rails 3.2.1 remote: Using coffee-rails 4.2.2 remote: Using jquery-rails 4.3.1 remote: Using rails 5.1.6 remote: Using sass-rails 5.0.6 remote: Bundle complete! 16 Gemfile dependencies, 57 gems now installed. remote: Gems in the groups development and test were not installed. remote: Bundled gems are installed into ./vendor/bundle. remote: Bundle completed (3.04s) remote: Cleaning up the bundler cache. remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.17.1). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. remote: The latest bundler is 2.0.0.pre.2, but you are currently running 1.15.2. remote: To update, run `gem install bundler --pre` remote: -----> Installing node-v8.10.0-linux-x64 remote: -----> Detecting rake tasks remote: -----> Preparing app for Rails asset pipeline remote: Running: rake assets:precompile remote: Yarn executable was not detected in the system. remote: Download Yarn at https://yarnpkg.com/en/docs/install remote: Asset precompilation completed (1.47s) remote: Cleaning assets remote: Running: rake assets:clean remote: -----> Detecting rails configuration remote: 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.4.5' remote: # See https://devcenter.heroku.com/articles/ruby-versions for more information. 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: -----> Discovering process types remote: Procfile declares types -> (none) remote: Default types for buildpack -> console, rake, web remote: remote: -----> Compressing... remote: Done: 64.9M remote: -----> Launching... remote: Released v11 remote: https://agile-basin-83218.herokuapp.com/ deployed to Heroku remote: remote: Verifying deploy... done. ### 補足情報(FW/ツールのバージョンなど) Cloud9を利用しています。 Ruby on Rails Tutorialの通りに記述しているつもりですが、どこに原因があるか分かりません。 とてつもなく初歩的な質問で申し訳ありませんが、お力を貸していただきたいと思います。
sakana-suki👍を押しています

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

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

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

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

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

guest

回答1

0

ベストアンサー

ec2-user:~/environment/toy_app (master) $ heroku create
Creating app... done, ⬢ aqueous-gorge-72050
https://aqueous-gorge-72050.herokuapp.com/ | https://git.heroku.com/aqueous-gorge-72050.git

ec2-user:~/environment/toy_app (master) $ git push heroku master
Counting objects: 5, done.

(中略)

remote: https://agile-basin-83218.herokuapp.com/ deployed to Heroku

をみる限り、アプリを作成したコマンドとデプロイのコマンドで異なるサーバーを利用しているようです。
新しく作成したheroku のリポジトリではなく、(元々の?)異なるホストにデプロイしているようです。

toy_app に設定されているリモートリポジトリは、どこになっていますか?(具体的には git remote -v の結果は、どうなっているでしょうか?)


古い heroku の git リポジトリを 新しく作った、git リポジトリに変更するのであれば、

git remote set-url heroku 新しいherokuのgitリポジトリURL

を実行して変更してください。

投稿2018/12/28 02:43

編集2018/12/28 02:46
CHERRY

総合スコア25171

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

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

asatosi

2018/12/28 09:21 編集

Cherry様、回答ありがとうございます。おかげさまで解決致しました。 【うまくいかなかったときの状態】 ec2-user:~/environment/toy_app (master) $ cat .git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] url = git@bitbucket.org:asatosi/toy_app.git fetch = +refs/heads/*:refs/remotes/origin/* [remote "heroku"] url = https://git.heroku.com/agile-basin-83218.git fetch = +refs/heads/*:refs/remotes/heroku/* [branch "master"] remote = origin merge = refs/heads/master 【変更コマンド】git remote set-url heroku https://git.heroku.com/aqueous-gorge-72050.git 【うまくいった時の状態】 ec2-user:~/environment/toy_app (master) $ cat .git/config[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] url = git@bitbucket.org:asatosi/toy_app.git fetch = +refs/heads/*:refs/remotes/origin/* [remote "heroku"] url = https://git.heroku.com/aqueous-gorge-72050.git fetch = +refs/heads/*:refs/remotes/heroku/* [branch "master"] remote = origin merge = refs/heads/master
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問