I'm new to RoR and after deploying I lose my assets. I tried pre-compiling assets locally, restarting the production server, deleting the app and reinstalling it again. None of these seemed to help. It works on development servers just fine.
They're not missing. It's likely that you're not using the rails_12factor
gem in the production
group in your Gemfile
:
group :production do
gem 'rails_12factor'
end
As mentioned in the Getting Started with Rails 4 article on Heroku's Dev Center .
Install that gem + deploy your app, and your assets should be there.
Please try this :
config/environments/production.rb
config.serve_static_assets = true
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.