I'm new to Ruby on Rails. I'm usin:
/ Cloud9 to make the ROR application
/ GitHub to store the files and update them
/ Hiroku for the production as a free service
When I run the application on Cloud9, it works properly:
https://ruby2016-bbparis.c9users.io/
When I push it to GitHub, it doesn't work on Heroku, and I get :
The page you were looking for doesn't exist.
You may have mistyped the address or the page may have moved.
If you are the application owner check the logs for more information.
capture screen
My route file is so simple :
Rails.application.routes.draw do
root 'pages#home'
get 'pages/about', to: 'pages#about'
end
How can I resolve this issue please ?
I assume you already have heroku repository created.
Try following command and it should work as your app works perfectly on c9
$ bundle update
$ heroku run rake db:migrate
$ heroku run rake db:schema:load
$ git init
$ git add .
$ git commit -am "some comment"
$ git push heroku master
$ git push heroku master
$ heroku open
I know your page doesn't have even database yet. I had similar problem in past and it helped me to resolve same problem.
run rake db:schema:load
basically load your schema into current environment's database. rake db:migrate
does migration for current environment which not run yet for more info on rake db commands follow this
It is recommended to use postgres
database in heroku because of tight integration with platform however there are many option for application currently running on MySQL
. For more information on how you can migrate to postgres
click here.