2

I updated my app to Rails 4 but it failed deploying to Heroku when running asset precompile. As other questions have touched on, I think this was failing due to attempting to find an ENV variable that didn't exist for my redis-to-go. So I added the Heroku labs feature mentioned in this post. I also followed Heroku's suggestions in this post.

That fixed the error during precompile but my assets aren't showing. Things I've done:

  • Added the rails_12factor gem
  • Tried running RAILS_ENV=production bundle exec rake assets:compile locally (after commenting out the redis ENV["redistogo_url"] bit
  • Added config.serve_static_assets = true to my production.rb file

Yet none of this seems to work. It could be that I didn't do this in the proper order. I know from other questions others have found success so am wondering what else I can try.

Community
  • 1
  • 1
tvalent2
  • 4,959
  • 10
  • 45
  • 87
  • Hi Travis! Did you get this working? – Andrew Atkinson Jan 24 '14 at 06:08
  • Hola @AndyAtkinson! I didn't, unfortunately. I'm going to go back and give it another go soon. I have another app running Rails 4 with assets, but it's a bit spotty. I must be doing something crazy. – tvalent2 Jan 26 '14 at 22:23
  • Ok, so after a crap ton of changes (including upgrading to Rails 4.1.5) I finally think this works. I was able to get by `rake assets:precompile` but the assets didn't show. It seems that in the update process I never set `config.action_dispatch.x_sendfile_header` to `nil` instead of `"X-Sendfile"`. – tvalent2 Sep 01 '14 at 22:37

1 Answers1

0

I came back to this after a while, and got it working. A few things since the last attempt:

  • I didn't need to precompile assets locally
  • I had to set config.action_dispatch.x_sendfile_header to nil in production.rb
  • Bundled and ran sprockets_better_errors gem locally, and added its recommendations in application.css.scss (even though I don't think I really needed to?)

That's about all.

tvalent2
  • 4,959
  • 10
  • 45
  • 87