I have followed book until chapter 5 finished and it\'s working OK in my linux workstation when I push to Heroku, all data pushed correctly but when I try to open Heroku (ht
I got the same error but realized that I hadn't change the HTML verb from GET to ROOT in config/routes.rb file.
It was get "/hello", to: "application#hello"
I updated it to root "application#hello"
I then pushed it to git and deployed it to production.
I had the same problem, but the thing is that the app is missing the home like root. The default home page for Heroku is this HTMLthe default page. But if you try all your defined routes they will work like:
appname.herokuapp.com/route
I'm using postgresql, and I also had page not showing up on heroku.
This command fixed it:
heroku run rake db:setup
and then
heroku rake db:migrate
I had migrated before, but hadn't done the setup first.
I also had tried setting
config.assets.compile = true
in production.rb, but that made no difference.
Specify Ruby version in app Rails 5 requires Ruby 2.2.0 or above. Heroku has a recent version of Ruby installed by default, however you can specify an exact version by using the ruby DSL in your Gemfile.
At the end of Gemfile add:
ruby "2.4.1"
Ran into this problem as well. Solved it by setting a root route. In my case, root 'pages#home'
in config/routes.rb
If the root route is not set, you are redirected to localhost:3000. Hence,
The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved.
Have you tried running in production mode locally? Try rails server -e production
and see if you get the same error, which you can then debug. Also make sure you've done heroku rake db:migrate
.