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