0

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 ?

bbparis
  • 127
  • 5

1 Answers1

0

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.

Community
  • 1
  • 1
Shyam Bhimani
  • 1,310
  • 1
  • 22
  • 37
  • Thank you so much Shyam !!!! it works Youuuuupeeee, I spent on it a lot of time. Could you please tell me what is happen exactly ? and also a question, if I use MySql, I will have a problem ? as if I understand good, Heroku doesn't accept MySQL, no? – bbparis May 28 '16 at 13:25
  • I am glad it worked for you. I have edited my answer to provide more clear idea. @bbparis – Shyam Bhimani May 28 '16 at 15:50