The layout of the website is broken (Heroku)
ChaikaPrime opened this issue · comments
I intend to deploy Selfstarter on Heroku by simly following the instructions.
The app was successfully uploaded, but when I open it I see that the layout of the website is broken and only text is rendered.
What could be the issue?
Thanks
Sounds like an Asset pipeline issue. Check your precompiled assets and
where are you serving them from?
Regards,
Ameen.
On Thu, Feb 20, 2014 at 4:22 PM, ChaikaPrime notifications@github.comwrote:
I intend to deploy Selfstarter on Heroku by simly following the
instructions.The app was successfully uploaded, but when I open it I see that the
layout of the website is broken and only text is rendered.
What could be the issue?
ThanksReply to this email directly or view it on GitHubhttps://github.com//issues/81
.
Hi Ameen,
Thank you for your reply, it gave me some idea what to look for.
It seems I solved the problem:
Firstly, I forgot to include rails_12factor gem as stated in Heroku manual:
https://devcenter.heroku.com/articles/rails-asset-pipeline
It solved the problem with the layout.
Secondly, I followed:
http://stackoverflow.com/questions/18324063/rails-4-images-not-loading-on-heroku
And modified production.rb to have:
config.serve_static_assets = true
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
config.assets.compile = true
The only problem is that I do not have enough experience to understand what it actually means...
UPDATE: The video button does not work though...
config.serve_static_assets = true
Absolutely needed. The default Rails production.rb assumes Apache or Nginx serves assets. The easiest way to diagnose this beingfalse
(off) is to view source, click on any .js or .css and get a 404 not found.config.assets.compile = true
won't help / won't hurt. Heroku precompiles most static assets during thegit push
. Most other things like views (templates) are served by Rails on-the-fly.config.action_dispatch.x_sendfile_header
on Heroku should benil
https://devcenter.heroku.com/articles/rack-sendfile
Thank you very much for your help!