Jump to content

The ultimate community for Ruby on Rails developers.


Deploying static assets in Rails 4

  • Please log in to reply
2 replies to this topic

#1 nicklombardi



  • Members
  • 2 posts

Posted 10 September 2013 - 02:32 PM

Specifically using Rails 4 and Heroku I ran into major difficulty deploying static assets where my only viable solution was to manually put them in my public folder. I would imagine this is frowned upon and would love a more elegant solution.

#2 Ohm



  • Moderators
  • 507 posts
  • LocationCopenhagen

Posted 10 September 2013 - 02:42 PM

You shouldn't ever have your assets and your code at the same place (e.g. on the same dyno)


I use S3 at work and Google Cloud Storage for hobby projects. The asset syncronisation and deployment can be done automatically with the asset_sync gem.

Blog: http://ohm.sh | Twitter: @madsohm | Work: Lokalebasen.dk

#3 Rowel



  • Members
  • 109 posts

Posted 10 September 2013 - 03:47 PM

I had problems with static assets at Heroku.  The fix was to delete my /cache directory and not upload this directory.  That way, Heroku pre-compiles all assets and everything works. 


If you upload your app and the /cache directory is detected, Heroku wouldn't pre-compile your assets... and then you may end up with missing files and assets because the server couldn't find them. 

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users