我在使用 Heroku 时遇到了真正的麻烦。看起来现在正在编译CSS,但仍然没有编译JS。我正在使用 Foundation 5 和 Rails 4。有什么想法吗?
生产.rbconfig.serve_static_assets = false
config.assets.precompile += %w( vendor/modernizr.js )
config.assets.js_compressor = :uglifier
config.assets.css_compressor = :sass
config.assets.compile = true
config.assets.digest = true`
应用程序.js
//= require jquery
//= require foundation
//= require jquery_ujs
//= require jquery.validate
//= require jquery.lockfixed
//= require sticky_footer
//= require list
//= require foundation.slider
//= require landing
//= require handlebars
//= require landing
//= require foundation.abide
$(function(){ $(document).foundation(); });
最佳答案
您可能已将 Assets 提交到 git 存储库。
你可以
# add assets to git ignore
echo "public/assets" >> .gitignore
# remove them from your git repo and from public
git rm -rf public/assets
# update your repo
git add public
git commit -m "Removed assets from repo"
# push to heroku again
git push heroku master
关于javascript - Heroku 不编译 javascript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23911943/