Rails tutorial Resolved an error deploying to Heroku, so note the solution

This is my first post on qiita. Rails-Tutorial Chapter 1 1.5.2 I suddenly stumbled upon deploying to Heroku. Even if I googled, the solution did not come out easily and I had a hard time at the beginning, so I wrote a memorandum of solution.

◆ Symptoms

As I proceeded according to the Rails-Tutorial text, I did "git push Heroku main" and it seemed that the deployment was successful, but the following screen was displayed. (If true, it should have been displayed as "Hello, World!".) スクリーンショット 2020-10-09 224816.png

◆ Cause

The cause was deploying to another repository on Heroku. I don't know the details, but if you trace the origin, it seems that the cause was that you had to execute the heroku command "heroku create" twice before deploying because you stopped eating once before deploying.

Deployment destination: Repository created for the first time URL you were browsing: The repository created for the second time

It was as above.

◆ Solution

(1) The push destination was changed to the repository created for the second time that was being browsed. (Execution of the following command)

Terminal


git remote set-url heroku ["heroku create"The git repository displayed in the terminal when you run]
② Execute push again

Terminal


git push heroku main

スクリーンショット 2020-10-09 230523.png

_ The screen is displayed safely. (It wasn't "hello, world!".) _

Recommended Posts

Rails tutorial Resolved an error deploying to Heroku, so note the solution
When deploying to Heroku, OpenApp causes an error
Error deploying rails5 + Mysql to heroku with Docker-compose
I can't deploy! Resolve an error that can't be pushed to heroku (Rails Tutorial Chapter 1)
I don't see an error in Rails bundle install ... the solution
The road to Japaneseizing Rails devise error messages
I got an "ActionView :: Template :: Error: Permission denied" error in the test of 3.3.1 of Rails tutorial 6th edition, so I solved it.
[Ruby on Rails Tutorial] Error in the test in Chapter 3
[Rails] How to display an image in the view
rails heroku error log
Solution for the error "no basic auth credentials" when pushing a Docker container to Heroku
[Rails] What to do if you can't get an error message with the errors method
Display an error screen during the download process to response
How to solve the problem that the website image is not displayed after deploying to heroku on Rails 5
[Note] What to do if bundle install in Chapter 3 of the rails tutorial is not possible
[Java] Adding an element to the Collection causes a compile error
[Rails / Heroku / MySQL] How to reset the DB of Rails application on Heroku
What to do if the Rails page doesn't appear in Rails tutorial 1.3.2
What to do if Cloud9 is full in the Rails tutorial
Rails Tutorial Extension: I tried to create an RSS feed function
Things to remember and concepts in the Ruby on Rails tutorial
Resolved the error that occurred when trying to use Spark in an environment where Java 8 and Java 11 coexist.