I have a couple static pages which when running locally work as localhost:3000/foo.html, but this doesn\'t work once uploaded to heroku.
I tried adding the following
Per this article, you will need to tell Rails to serve static assets itself with:
config.serve_static_assets = true
in your config/environments/production.rb
This baffled me for hours, but here's another potential solution. For some reason, I could generate documentation into /public/docs
, but the documentation would not load, even immediately after I generated it. I would run a Heroku bash console, generate the documentation, exit, then re-run Heroku bash only to find that /public
no longer contained my docs
folder.
So, the only solution I found was to include the documentation in the Git repository. That was the only way that Heroku persisted /public/docs
across deploys and bash instances.
I have no idea why this is... I opened a support ticket with Heroku and am awaiting a response.
Alternatively you can add the rails_12factor
gem to the production group:
gem 'rails_12factor', group: :production
according to Heroku. This will also redirect log to stdout
as also required by Heroku.