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 had a very similiar issue with heroku, found the answer from this question:
RefineryCMS routes for Home page doesn't work
To save you reading, the solution was to update "Home" using Advanced Options, there is a question:
"Forward this page to another website or page"
Fill this in with a /
and it should work. This sounds a little backwards, as its actually setting /my_page to redirect to "/". But the way to think of it is:
Refinery pages extension is looking for a page with the url '/' to be the home page. So by telling the page titled "Home" that you want it to have the url '/' you're setting it as the definitive homepage as far as Refinery pages extension is concerned. (quote from @Philip Arndt)
I know it's an old problem but I ran into it too. I realized I didn't change the root route in config/routes.rb
before pushing. Not changing it might result in a welcome page locally, but on heroku it will get the above error.
I was facing the same error because I pushed same non-master branch to heroku master using this command git push heroku master
. Which obviously cause conflicts.
I also checked the routes using heroku run rake routes
. But the output was not my actual routes. Not even single one.
The proper way to push your non-master branch to heroku master is
git push -f heroku your_branch_name:master
So I had to run in this order and it worked for me
$ heroku rake db:migrate
$ heroku run rake db:setup
I got the same problem; however, after changing 1 line code of production.rb located in config/environments/production.rb
from
config.assets.compile = false
to
config.assets.compile = true
commit the new change. Then my sample app works fine on heroku
1. Always set a root in routes. That's rails 101
I wouldn't go for making asset pre-compilation false all the time. For production app I feel it enhances the overall speed if assets have been pre-compiled.
2. As a rule of thumb I always run rake assets:precompile
before pushing to git. Please try it. and then commit to git repository and then heroku. Do heroku restart
3. Another cause could be heroku rake db:migrate, please check if you did it
4. Also this is my Gemfile setup for the development and production groups
group :development do
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_12factor'
gem 'heroku-deflater'
end