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 to the routes.rb file:
match '/foo', :to => redirect('/public/foo.html')
but that doesn't seem to work, it redirects me to foobar.com/public/foo.html, but still finds nothing there.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With