Rails 5生产应用程序中的Heroku JS错误 [英] Heroku JS error in Rails 5 production app

查看:66
本文介绍了Rails 5生产应用程序中的Heroku JS错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在有两个月的问题,我在这个问题的无数线索中找到的答案都没有解决我的问题。所以我给它另一个令人沮丧的尝试:



当我的应用程序在Heroku上运行时,我得到一个JavaScript错误。



我在浏览器控制台中遇到的错误是:

 未捕获的TypeError :ht.each不是函数
。在应用b030a52a6989f6564d19974180747e99f4ac5a28109188d096b47fc12a38f2cf.js:1个
。在应用b030a52a6989f6564d19974180747e99f4ac5a28109188d096b47fc12a38f2cf.js:1个
。在应用b030a52a6989f6564d19974180747e99f4ac5a28109188d096b47fc12a38f2cf.js:1个

当我在本地生产我的应用程序时,我不会收到此错误,这是因为我的


/ public / assets


文件夹如下所示:

  .sprockets-manifest-a7e0d8d7f0627b40ca52eea9623fee45.json 
application-a358e1eb31a8f590691be18692bb2f57be910bbb2c5800a4dcb95a6c56deb358.js
应用a358e1eb31a8f590691be18692bb2f57be910bbb2c5800a4dcb95a6c56deb358.js.gz
应用ea2c1b8977f914f6ea0d3aa17e9a18079d0fd8ab6b9aa1a88609bcaba62135d5.css
应用ea2c1b8977f914f6ea0d3aa17e9a18079d0fd8ab6b9aa1a88609bcaba62135d5.css.gz
引导
导轨-c094bc3a4bf50e5bb477109e5cb0d213af27ad75b481c4df249f50974dbeefe6.png

在Heroku上,同一个文件夹包含以下内容:



'pre> 应用18082fe8586b430e37211d8a126c18df28136b583c39a4a6ceb1418202d665a3.css
应用18082fe8586b430e37211d8a126c18df28136b583c39a4a6ceb1418202d665a3.css.gz
应用8344b3a5f740968bd820e663ceac72950f2c3dbec18583fa38efec5788e87e31.js
应用8344b3a5f740968bd820e663ceac72950f2c3dbec18583fa38efec5788e87e31.js。 gz
application-a5ee6c15ec2d7545c56a0340738bf8bf07d80b954e685fd04cff6067f34ec439.css
application-a5ee6c15ec2d7545c56a0340738bf8bf07d80b954e685fd04cff6067f34ec439.cs s.gz
应用b030a52a6989f6564d19974180747e99f4ac5a28109188d096b47fc12a38f2cf.js
应用b030a52a6989f6564d19974180747e99f4ac5a28109188d096b47fc12a38f2cf.js.gz
应用baa8861fe552f67418ef50a3fcdbb69e3a2ab43226917999d296f85bb407d3e2.js
应用baa8861fe552f67418ef50a3fcdbb69e3a2ab43226917999d296f85bb407d3e2.js.gz
应用cb3abf099471b60aa6a5318e339b92c962f22034d16f78b0f6700a1a4abf42dd .css
application-cb3abf099471b60aa6a5318e339b92c962f22034d16f78b0f6700a1a4abf42dd.css.gz
bootstrap

在本地,这些JavaScript文件被加载到发生错误的站点:

 < script src =/ assets / jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js?body = 1data-turbolinks-track =oad>< / script> 
< script src =/ assets / bootstrap.self-b38817c3e3a3049abb1fc08dd6ae448b23330f8453226efdb074710209474f75.js?body = 1data-turbolinks-track =reload>< / script>
< script src =/ assets / rails-ujs.self-3b600681e552d8090230990c0a2e8537aff48159bea540d275a620d272ba33a0.js?body = 1data-turbolinks-track =reload>< / script>
< script src =/ assets / turbolinks.self-569ee74eaa15c1e2019317ff770b8769b1ec033a0f572a485f64c82ddc8f989e.js?body = 1data-turbolinks-track =reload>< / script>
< script src =/ assets / action_cable.self-69fddfcddf4fdef9828648f9330d6ce108b93b82b0b8d3affffc59a114853451.js?body = 1data-turbolinks-track =reload>< / script>
< script src =/ assets / cable.self-8484513823f404ed0c0f039f75243bfdede7af7919dda65f2e66391252443ce9.js?body = 1data-turbolinks-track =reload>< / script>
< script src =/ assets / forum.self-877aef30ae1b040ab8a3aba4e3e309a11d7f2612f44dde450b5c157aa5f95c05.js?body = 1data-turbolinks-track =reload>< / script>
< script src =/ assets / sessions.self-877aef30ae1b040ab8a3aba4e3e309a11d7f2612f44dde450b5c157aa5f95c05.js?body = 1data-turbolinks-track =reload>< / script>
< script src =/ assets / users.self-877aef30ae1b040ab8a3aba4e3e309a11d7f2612f44dde450b5c157aa5f95c05.js?body = 1data-turbolinks-track =reload>< / script>
< script src =/ assets / application.self-12be097b9a2442b0b6cdcb5146d1d63c00abcde3675ff34d1de6126cb13e6714.js?body = 1data-turbolinks-track =reload>< / script>

但是在Heroku网站上只加载了这个JS文件(看来由所有在本地加载但现在相互冲突但我真的不知道的那些组成。

 < script src =/ assets / application-b030a52a6989f6564d19974180747e99f4ac5a28109188d096b47fc12a38f2cf.jsdata-turbolinks-track =reload>< / script> 

有人可以帮助我让它在Heroku上运行吗?



有问题的代码是迈克尔·哈特尔(Michael Hartl)的标准sample_app,他的代码是1对1,它或多或少地适用于其他所有人,但不适合我。



我在Windows上使用Rails和Ruby最新



我尝试过:



#1:预编译public / assets文件夹并清理然后推送,这当然很愚蠢,因为git没有推送此文件夹,但人们建议我按照



#2:删除上面的文件夹,然后推送它,再次像上面一样的问题......



#3:以可能的方式重新排列 app / assets / javascripts / application.js 文件中的require语句

  // = require jquery 
// = require bootstrap
// = require rails-ujs
// =需要turbolinks
// = requ ire_tree。

4:更多适用于其他人的解决方案当一个人搜索Heroku Javascript错误,生产中的Heroku rails javascript错误,Heroku rails DELETE方法在生产中无法正常工作以及更多内容时,可以找到堆栈溢出,正如我所说我正在寻找解决方案已经有2个月了,我已经有足够的时间尝试放弃2,3小时无效的搜索。



#5 这工作:复制将代码从 / config / environments / development 粘贴到 / config / environments / production



/ config / environments / development

 # frozen_string_literal:true 

Rails.application.configure do
#此处指定的设置优先于
#config / application.rb中的设置。

#在开发环境中,每个请求都会在
#上重新加载应用程序的代码。这会减慢响应时间,但对于开发
#是完美的,因为您在进行代码更改时不必重新启动Web服务器。
config.cache_classes = false

#不要急于在启动时加载代码。
config.eager_load = false

#显示完整的错误报告。
config.consider_all_requests_local = true

#启用/禁用缓存。默认情况下,禁用缓存。
#运行rails dev:cache来切换缓存。如果Rails.root.join('tmp','caching-dev.txt')存在,

config.action_controller.perform_caching = true

config.cache_store =:memory_store
config.public_file_server.headers = {
'Cache-Control'=> public,max-age =#{2.days.to_i}
}
else
config.action_controller.perform_caching = false

config.cache_store =: null_store
end

#将上传的文件存储在本地文件系统上(参见config / storage.yml
#for options)
config.active_storage.service =:local

#不在乎邮件是否无法发送。
config.action_mailer.raise_delivery_errors = true

config.action_mailer.perform_caching = true

config.action_mailer.delivery_method =:test

host ='localhost:3000'

config.action_mailer.default_url_options = {host:'localhost:3000'}

config.action_mailer.delivery_method =:smtp
config.action_mailer.smtp_settings = {
地址:'smtp.gmail.com',
端口:587,
域名:'example.com',
user_name:'## #',
密码:'###',
身份验证:'普通',
enable_starttls_auto:true
}

#打印弃用通知到Rails记录器。
config.active_support.deprecation =:log

#如果有待处理的迁移,则在页面加载时引发错误。
config.active_record.migration_error =:page_load

#突出显示在日志中触发数据库查询的代码。
config.active_record.verbose_query_logs = true

#调试模式禁用资产的连接和预处理。
#此选项可能会导致使用大量
#复杂资产的视图渲染出现严重延迟。
config.assets.debug = true

#抑制资产请求的记录器输出。
config.assets.quiet = true

#引发缺失翻译的错误
#config.action_view.raise_on_missing_translations = true

#使用偶数文件观察者异步检测源代码中的变化,
#routes,locales等。此功能取决于listen gem。
#config.file_watcher = ActiveSupport :: EventedFileUpdateChecker
end

/ config / environments / production

 #frozen_string_literal:true 

Rails.application。 configure do
#此处指定的设置优先于
#config / application.rb中的设置。

#代码不会在请求之间重新加载。
config.cache_classes = true

#在启动时加载代码。这种渴望加载大多数Rails和
#你的应用程序在内存中,允许两个线程Web服务器
#和那些依赖于写入时复制的服务器执行得更好。
#Rake任务会自动忽略此选项以提高性能。
config.eager_load = true

#禁用完整错误报告并启用缓存。
config.consider_all_requests_local = false
config.action_controller.perform_caching = true

#确保在
#ENV [RAILS_MASTER_KEY中提供主密钥]
#或在config / master.key中。此密钥用于解密凭证
#和其他加密文件)。
#config.require_master_key = true

#默认情况下禁用来自`/ public`文件夹的静态文件,因为
#Apache或NGINX已经处理过这个问题。
config.public_file_server.enabled = ENV ['RAILS_SERVE_STATIC_FILES']。现在?

#压缩JavaScripts和CSS。
config.assets.js_compressor =:uglifier
#config.assets.css_compressor =:sass

#如果遗漏了预编译资产,请不要回退到资产管道。
config.assets.compile = false

#`config.assets.precompile`和`config.assets.version`已将
#移至config / initializers / assets.rb

#从资产服务器启用图像,样式表和JavaScripts的服务。
#config.action_controller.asset_host ='http://assets.example.com'

#指定服务器用于发送文件的标头。
#config.action_dispatch.x_sendfile_header ='X-Sendfile'#for Apache
#config.action_dispatch.x_sendfile_header ='X-Accel-Redirect'#for NGINX

#Store上传的文件在本地文件系统上
#(参见config / storage.yml for options)
config.active_storage.service =:local

#挂载主进程外部的操作电缆或domain
#config.action_cable.mount_path = nil
#config.action_cafsdfsdble.url ='wss://example.com/cable'
#config.action_cable.allowed_request_origins = ['http: //example.com',
#/http:\/\/example.*/]

#强制通过SSL强制访问应用,使用Strict-Transport-Security ,
#并使用安全cookie。
config.force_ssl = false

#使用最低日志级别确保出现问题时诊断信息
#的可用性。
config.log_level =:debug

#使用以下标记添加所有日志行。
config.log_tags = [:request_id]

#在生产中使用不同的缓存存储。
#config.cache_store =:mem_cache_store

#为活动作业使用真正的排队后端(并为每个环境单独
#队列)
#config.active_job.queue_adapter =:resque
#config.active_job.queue_name_prefix =sample_app _#{Rails.env}

config.action_mailer.perform_caching = false
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method =:smtp
host ='mighty-springs-34070.herokuapp.com'
config.action_mailer.default_url_options = {host:host}
ActionMailer :: Base.smtp_settings = {
地址:'smtp.gmail.com',
端口:587,
域名:'example.com',
user_name:'#### ',
密码:'####',
身份验证:'普通',
enable_starttls_auto:true
}

#忽略错误的电子邮件地址并且不要提高电子邮件发送RORS。
#将此设置为true并将电子邮件服务器配置为立即交付到
#raise delivery errors。
#config.action_mailer.raise_delivery_errors = false

#启用I18n的语言环境回退(使查找任何语言环境都回落到
#I18n.default_locale,当找不到翻译时)。
config.i18n.fallbacks = true

#向已注册的听众发送弃用通知。
config.active_support.deprecation =:notify

#使用默认的日志记录格式化程序,以便不抑制PID和时间戳。
config.log_formatter = :: Logger :: Formatter.new

#使用不同的记录器进行分布式设置。
#require'syslog / logger'
#config.logger = ActiveSupport :: TaggedLogging.new(Syslog :: Logger.new
#'app-name')

如果ENV ['RAILS_LOG_TO_STDOUT']。存在?
logger = ActiveSupport :: Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport :: TaggedLogging.new(logger)
end

#迁移后不要转储模式。
config.active_record.dump_schema_after_migration = false
结束

感谢阅读

解决方案

这是 uglifier gem。我将 4.1.18 降级为 3.0.4


I have an issues for 2 months now and none of the answers that I got here in my countless threads about this issue have resolved my problem. So I give it another frustrating try:

It is a JavaScript error that I get when my App runs in production on Heroku.

The Error that I get in the Browser Console is this:

Uncaught TypeError: ht.each is not a function
at application-b030a52a6989f6564d19974180747e99f4ac5a28109188d096b47fc12a38f2cf.js:1
at application-b030a52a6989f6564d19974180747e99f4ac5a28109188d096b47fc12a38f2cf.js:1
at application-b030a52a6989f6564d19974180747e99f4ac5a28109188d096b47fc12a38f2cf.js:1

When I run my App in production locally I dont get this error, this is because my

/public/assets

folder looks like this:

.sprockets-manifest-a7e0d8d7f0627b40ca52eea9623fee45.json
application-a358e1eb31a8f590691be18692bb2f57be910bbb2c5800a4dcb95a6c56deb358.js
application-a358e1eb31a8f590691be18692bb2f57be910bbb2c5800a4dcb95a6c56deb358.js.gz
application-ea2c1b8977f914f6ea0d3aa17e9a18079d0fd8ab6b9aa1a88609bcaba62135d5.css
application-ea2c1b8977f914f6ea0d3aa17e9a18079d0fd8ab6b9aa1a88609bcaba62135d5.css.gz
bootstrap
rails-c094bc3a4bf50e5bb477109e5cb0d213af27ad75b481c4df249f50974dbeefe6.png

On Heroku the very same folder has these contents:

application-18082fe8586b430e37211d8a126c18df28136b583c39a4a6ceb1418202d665a3.css
application-18082fe8586b430e37211d8a126c18df28136b583c39a4a6ceb1418202d665a3.css.gz
application-8344b3a5f740968bd820e663ceac72950f2c3dbec18583fa38efec5788e87e31.js
application-8344b3a5f740968bd820e663ceac72950f2c3dbec18583fa38efec5788e87e31.js.gz
application-a5ee6c15ec2d7545c56a0340738bf8bf07d80b954e685fd04cff6067f34ec439.css
application-a5ee6c15ec2d7545c56a0340738bf8bf07d80b954e685fd04cff6067f34ec439.css.gz
application-b030a52a6989f6564d19974180747e99f4ac5a28109188d096b47fc12a38f2cf.js
application-b030a52a6989f6564d19974180747e99f4ac5a28109188d096b47fc12a38f2cf.js.gz
application-baa8861fe552f67418ef50a3fcdbb69e3a2ab43226917999d296f85bb407d3e2.js
application-baa8861fe552f67418ef50a3fcdbb69e3a2ab43226917999d296f85bb407d3e2.js.gz
application-cb3abf099471b60aa6a5318e339b92c962f22034d16f78b0f6700a1a4abf42dd.css
application-cb3abf099471b60aa6a5318e339b92c962f22034d16f78b0f6700a1a4abf42dd.css.gz
bootstrap

On local these JavaScript files are loaded into the site where the Error occurs:

<script src="/assets/jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/bootstrap.self-b38817c3e3a3049abb1fc08dd6ae448b23330f8453226efdb074710209474f75.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/rails-ujs.self-3b600681e552d8090230990c0a2e8537aff48159bea540d275a620d272ba33a0.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/turbolinks.self-569ee74eaa15c1e2019317ff770b8769b1ec033a0f572a485f64c82ddc8f989e.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/action_cable.self-69fddfcddf4fdef9828648f9330d6ce108b93b82b0b8d3affffc59a114853451.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/cable.self-8484513823f404ed0c0f039f75243bfdede7af7919dda65f2e66391252443ce9.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/forum.self-877aef30ae1b040ab8a3aba4e3e309a11d7f2612f44dde450b5c157aa5f95c05.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/sessions.self-877aef30ae1b040ab8a3aba4e3e309a11d7f2612f44dde450b5c157aa5f95c05.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/users.self-877aef30ae1b040ab8a3aba4e3e309a11d7f2612f44dde450b5c157aa5f95c05.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/application.self-12be097b9a2442b0b6cdcb5146d1d63c00abcde3675ff34d1de6126cb13e6714.js?body=1" data-turbolinks-track="reload"></script>

But on Heroku the site only loads this one JS file (which seems to be made of all the ones that are loaded locally and now conflicting each other but I dont really know)

<script src="/assets/application-b030a52a6989f6564d19974180747e99f4ac5a28109188d096b47fc12a38f2cf.js" data-turbolinks-track="reload"></script>

can someone please help me to get it running on Heroku?

The code in question is the standard "sample_app" by Michael Hartl doing his code 1-to-1 and it works for everyone else more or less but not for me.

I am working on Windows with Rails and Ruby up-to-date

What I have tried:

#1: precompiling the public/assets folder and cleaning up then pushing, which is of course silly because git doesnt push this folder but people suggested I followed

#2: deleting the folder above and then push it, again same problem like above...

#3: rearranging the require statements in my app/assets/javascripts/application.js file in every possible way:

//= require jquery
//= require bootstrap
//= require rails-ujs
//= require turbolinks
//= require_tree .

4: many more "solutions" that worked for others which are easily findable on stack overflow when one searches for things like "Heroku Javascript error", "Heroku rails javascript error in production", "Heroku rails DELETE method doesnt work in production" and many more, as I said I am on the search for a solution for 2 months now allready, Ive had plenty of time to try and give up after 2,3 hours of fruitless search.

#5 This has worked: Copy Paste the code from /config/environments/development into /config/environments/production

/config/environments/development

# frozen_string_literal: true

Rails.application.configure do
  # Settings specified here will take precedence over those in
  # config/application.rb.

  # In the development environment your application's code is reloaded on
  # every request. This slows down response time but is perfect for development
  # since you don't have to restart the web server when you make code changes.
  config.cache_classes = false

  # Do not eager load code on boot.
  config.eager_load = false

  # Show full error reports.
  config.consider_all_requests_local = true

  # Enable/disable caching. By default caching is disabled.
  # Run rails dev:cache to toggle caching.
  if Rails.root.join('tmp', 'caching-dev.txt').exist?
    config.action_controller.perform_caching = true

    config.cache_store = :memory_store
    config.public_file_server.headers = {
      'Cache-Control' => "public, max-age=#{2.days.to_i}"
    }
  else
    config.action_controller.perform_caching = false

    config.cache_store = :null_store
  end

  # Store uploaded files on the local file system (see config/storage.yml
  # for options)
  config.active_storage.service = :local

  # Don't care if the mailer can't send.
  config.action_mailer.raise_delivery_errors = true

  config.action_mailer.perform_caching = true

  config.action_mailer.delivery_method = :test

  host = 'localhost:3000'

  config.action_mailer.default_url_options = { host: 'localhost:3000' }

  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    address:              'smtp.gmail.com',
    port:                 587,
    domain:               'example.com',
    user_name:            '###',
    password:             '###',
    authentication:       'plain',
    enable_starttls_auto: true
  }

  # Print deprecation notices to the Rails logger.
  config.active_support.deprecation = :log

  # Raise an error on page load if there are pending migrations.
  config.active_record.migration_error = :page_load

  # Highlight code that triggered database queries in logs.
  config.active_record.verbose_query_logs = true

  # Debug mode disables concatenation and preprocessing of assets.
  # This option may cause significant delays in view rendering with a large
  # number of complex assets.
  config.assets.debug = true

  # Suppress logger output for asset requests.
  config.assets.quiet = true

  # Raises error for missing translations
  # config.action_view.raise_on_missing_translations = true

  # Use an evented file watcher to asynchronously detect changes in source code,
  # routes, locales, etc. This feature depends on the listen gem.
  # config.file_watcher = ActiveSupport::EventedFileUpdateChecker
end

/config/environments/production

# frozen_string_literal: true

Rails.application.configure do
  # Settings specified here will take precedence over those in
  #  config/application.rb.

  # Code is not reloaded between requests.
  config.cache_classes = true

  # Eager load code on boot. This eager loads most of Rails and
  # your application in memory, allowing both threaded web servers
  # and those relying on copy on write to perform better.
  # Rake tasks automatically ignore this option for performance.
  config.eager_load = true

  # Full error reports are disabled and caching is turned on.
  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true

  # Ensures that a master key has been made available in either
  #  ENV["RAILS_MASTER_KEY"]
  # or in config/master.key. This key is used to decrypt credentials
  # and other encrypted files).
  # config.require_master_key = true

  # Disable serving static files from the `/public` folder by default since
  # Apache or NGINX already handles this.
  config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?

  # Compress JavaScripts and CSS.
  config.assets.js_compressor = :uglifier
  # config.assets.css_compressor = :sass

  # Do not fallback to assets pipeline if a precompiled asset is missed.
  config.assets.compile = false

  # `config.assets.precompile` and `config.assets.version` have moved
  #  to config/initializers/assets.rb

  # Enable serving of images, stylesheets, and JavaScripts from an asset server.
  # config.action_controller.asset_host = 'http://assets.example.com'

  # Specifies the header that your server uses for sending files.
  # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
  # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX

  # Store uploaded files on the local file system
  # (see config/storage.yml for options)
  config.active_storage.service = :local

  # Mount Action Cable outside main process or domain
  # config.action_cable.mount_path = nil
  # config.action_cafsdfsdble.url = 'wss://example.com/cable'
  # config.action_cable.allowed_request_origins = [ 'http://example.com',
  # /http:\/\/example.*/ ]

  # Force all access to the app over SSL, use Strict-Transport-Security,
  # and use secure cookies.
  config.force_ssl = false

  # Use the lowest log level to ensure availability of diagnostic information
  # when problems arise.
  config.log_level = :debug

  # Prepend all log lines with the following tags.
  config.log_tags = [:request_id]

  # Use a different cache store in production.
  # config.cache_store = :mem_cache_store

  # Use a real queuing backend for Active Job (and separate
  # queues per environment)
  # config.active_job.queue_adapter     = :resque
  # config.active_job.queue_name_prefix = "sample_app_#{Rails.env}"

  config.action_mailer.perform_caching = false
  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.delivery_method = :smtp
  host = 'mighty-springs-34070.herokuapp.com'
  config.action_mailer.default_url_options = { host: host }
  ActionMailer::Base.smtp_settings = {
    address:              'smtp.gmail.com',
    port:                 587,
    domain:               'example.com',
    user_name:            '####',
    password:             '####',
    authentication:       'plain',
    enable_starttls_auto: true
  }

  # Ignore bad email addresses and do not raise email delivery errors.
  # Set this to true and configure the email server for immediate delivery to
  # raise delivery errors.
  # config.action_mailer.raise_delivery_errors = false

  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
  # the I18n.default_locale when a translation cannot be found).
  config.i18n.fallbacks = true

  # Send deprecation notices to registered listeners.
  config.active_support.deprecation = :notify

  # Use default logging formatter so that PID and timestamp are not suppressed.
  config.log_formatter = ::Logger::Formatter.new

  # Use a different logger for distributed setups.
  # require 'syslog/logger'
  # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new
  # 'app-name')

  if ENV['RAILS_LOG_TO_STDOUT'].present?
    logger           = ActiveSupport::Logger.new(STDOUT)
    logger.formatter = config.log_formatter
    config.logger    = ActiveSupport::TaggedLogging.new(logger)
  end

  # Do not dump schema after migrations.
  config.active_record.dump_schema_after_migration = false
end

Thanks for reading

解决方案

It was the uglifier gem. I downgraded from 4.1.18 to 3.0.4

这篇关于Rails 5生产应用程序中的Heroku JS错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆