0
未捕獲的ReferenceError JS生產問題:圖表沒有定義軌道4個在Heroku /資產編譯
對於所有在那裏JS工作不正常的地方,我收到此基礎上JS文件,它嘗試讀取類似的錯誤。
在開發中,我所有的JS都在正確地讀取和執行。在生產中,一些JS不是。這裏是我的application.js文件,其中有關哪些正在工作,哪些不在。
的application.js
//= require jquery # working
//= require bootstrap.min # working
//= require jquery_ujs # working
//= require turbolinks # working
//= require jquery.ui.all # working
//= require jquery.sidr.min # working
//= require jquery_timepicker_addon # working
//= require infobox # working
//= require buttons # not working
//= require tooltip # not working
//= require deliveries # not working
//= require Chart# not working
//= require jquery-addressPicker # working
//= require_tree .
我跑RAILS_ENV =產品包的exec耙資產:預編譯 和我最近讀到一篇博客文章中提示運行耙資產:資產清理:預編譯,但沒有解決不了的問題
production.rb
config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = false
config.assets.js_compressor = :uglifier
config.assets.digest = true
config.assets.version = '1.0'
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
config.assets.compile = false
如何調試這個問題的任何幫助,將不勝感激!
deliveries.js.coffee是我自己寫的唯一文件。其他人全部來自外部圖書館。
jQuery ->
mixes = $('#order_mix_id').html()
$('#order_job_id').change ->
job = $('#order_job_id :selected').text()
escaped_job = job.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1')
options = $(mixes).filter("optgroup[label='#{escaped_job}']").html()
if options
$('#order_mix_id').html(options)
else
$('#order_mix_id').empty()
RAILS_ENV =生產耙資產:資產清理:預編譯有助於確保資產每次預編譯時被改寫乾淨 – avalente1