我的 CSS 和图像没有进入 Heroku。但我按照他们的教程所说的做了。
RAILS_ENV=production bundle exec rake assets:precompile
git add public/assets
git commit -m "assets added"
然后我用 Heroku 推送并获取
-----> Preparing app for Rails asset pipeline
Detected manifest file, assuming assets were compiled locally
所以我的资源被推送了,但我的 Heroku 应用程序上仍然没有 css 图像或任何内容。有什么想法吗?
最佳答案
尽量不要将您的 Assets 发送到heroku。
从 git 中删除公共(public)/ Assets :
git rm -r public/assets
git commit -m "Remove assets"
如果仍然无法正常工作,请在 config/environments/Production.rb 上设置:
config.assets.compile = true
您也可以尝试在 config/environments/development.rb 上设置:
config.serve_static_assets = true
关于ruby-on-rails - 将 Rail4 Assets 管道获取到 heroku,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19329666/