0

所以我部署到 heroku 并且我的 javascript 不存在。然而,css 编译得很好。

我的生产.rb

 # Disable Rails's static asset server (Apache or nginx will already do this)
 config.serve_static_assets = false

 # Compress JavaScripts and CSS
 config.assets.compress = true

 # Don't fallback to assets pipeline if a precompiled asset is missed
 config.assets.compile = true

我的 application.js 文件

 // This is a manifest file that'll be compiled into including all the files listed   below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll     automatically
// be included in the compiled file accessible from  http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the     bottom of the
// the compiled file.
//

//= require jquery
//= require jquery_ujs
//= require "bootstrap.js"
//= require "demo.js"
//= require "highcharts.js"
//= require_tree .

由于另一个问题因此得到解决,因此尝试使用和不使用 .js 扩展名。

heroku 日志中没有任何内容,在 heroku slug 创建期间没有错误。

有任何想法吗?

4

0 回答 0