Rails:ExecJS :: ProgramError:RangeError:超出最大调用堆栈大小
Posted
技术标签:
【中文标题】Rails:ExecJS :: ProgramError:RangeError:超出最大调用堆栈大小【英文标题】:Rails : ExecJS::ProgramError: RangeError: Maximum call stack size exceeded 【发布时间】:2016-01-13 12:17:00 【问题描述】:当我编译资产以在 ENV=production 上运行项目时
RAILS_ENV=production bundle exec rake assets:precompile
错误:
ExecJS::ProgramError: RangeError: 超出最大调用堆栈大小 (在/home/kop/rails/donghoxteen/vendor/assets/javascripts/spree/frontend/all.js) 令牌((execjs)) skip_line_comment ((execjs):2359:14462) 句柄斜线((execjs):2359:16320) next_token ((execjs):2359:17382) skip_line_comment ((execjs):2359:14521) 句柄斜线((execjs):2359:16320) next_token ((execjs):2359:17382) skip_line_comment ((execjs):2359:14521) 句柄斜线((execjs):2359:16320) next_token ((execjs):2359:17382) skip_line_comment ((execjs):2359:14521) 句柄斜线((execjs):2359:16320) next_token ((execjs):2359:17382) skip_line_comment ((execjs):2359:14521) 句柄斜线((execjs):2359:16320) /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/execjs-2.5.2/lib/execjs/ruby_racer_runtime.rb:47:in
rescue in block in call' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/execjs-2.5.2/lib/execjs/ruby_racer_runtime.rb:44:in
block in call' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/execjs-2.5.2/lib/execjs/ruby_racer_runtime.rb:75:inblock in lock' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/execjs-2.5.2/lib/execjs/ruby_racer_runtime.rb:73:in
call' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/execjs-2.5.2/lib/execjs/ruby_racer_runtime.rb:73:inLocker' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/execjs-2.5.2/lib/execjs/ruby_racer_runtime.rb:73:in
lock' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/execjs-2.5.2/lib/execjs/ruby_racer_runtime.rb:43:incall' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/uglifier-2.7.1/lib/uglifier.rb:212:in
run_uglifyjs' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/uglifier-2.7.1/lib/uglifier.rb:179:incompile' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/uglifier_compressor.rb:25:in
evaluate' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/tilt-1.4.1/lib/tilt/template.rb:103:inrender' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/context.rb:197:in
block in evaluate' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/context.rb:194:ineach' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/context.rb:194:in
evaluate' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/bundled_asset.rb:25:ininitialize' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/base.rb:377:in
new' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/base.rb:377:inbuild_asset' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/index.rb:94:in
block in build_asset' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/caching.rb:58:incache_asset' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/index.rb:93:in
build_asset' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/base.rb:287:infind_asset' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/index.rb:61:in
find_asset' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:211:inblock in find_asset' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:257:in
benchmark' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:210:infind_asset' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:119:in
block in compile' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:118:ineach' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:118:in
compile' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-rails-2.3.2/lib/sprockets/rails/task.rb:70:inblock (3 levels) in define' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/rake/sprocketstask.rb:146:in
with_logger' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-rails-2.3.2/lib/sprockets/rails/task.rb:69:inblock (2 levels) in define' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/bin/ruby_executable_hooks:15:in
eval' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/bin/ruby_executable_hooks:15:in<main>' V8::Error: Maximum call stack size exceeded at token (<eval>:1:0) at skip_line_comment (<eval>:2359:14462) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) at next_token (<eval>:2359:17382) at skip_line_comment (<eval>:2359:14521) at handle_slash (<eval>:2359:16320) /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/execjs-2.5.2/lib/execjs/ruby_racer_runtime.rb:45:in
block in call' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/execjs-2.5.2/lib/execjs/ruby_racer_runtime.rb:75:inblock in lock' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/execjs-2.5.2/lib/execjs/ruby_racer_runtime.rb:73:in
call' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/execjs-2.5.2/lib/execjs/ruby_racer_runtime.rb:73:inLocker' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/execjs-2.5.2/lib/execjs/ruby_racer_runtime.rb:73:in
lock' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/execjs-2.5.2/lib/execjs/ruby_racer_runtime.rb:43:incall' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/uglifier-2.7.1/lib/uglifier.rb:212:in
run_uglifyjs' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/uglifier-2.7.1/lib/uglifier.rb:179:incompile' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/uglifier_compressor.rb:25:in
evaluate' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/tilt-1.4.1/lib/tilt/template.rb:103:inrender' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/context.rb:197:in
block in evaluate' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/context.rb:194:ineach' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/context.rb:194:in
evaluate' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/bundled_asset.rb:25:ininitialize' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/base.rb:377:in
new' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/base.rb:377:inbuild_asset' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/index.rb:94:in
block in build_asset' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/caching.rb:58:incache_asset' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/index.rb:93:in
build_asset' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/base.rb:287:infind_asset' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/index.rb:61:in
find_asset' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:211:inblock in find_asset' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:257:in
benchmark' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:210:infind_asset' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:119:in
block in compile' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:118:ineach' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:118:in
compile' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-rails-2.3.2/lib/sprockets/rails/task.rb:70:inblock (3 levels) in define' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-2.12.4/lib/rake/sprocketstask.rb:146:in
with_logger' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/sprockets-rails-2.3.2/lib/sprockets/rails/task.rb:69:inblock (2 levels) in define' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/bin/ruby_executable_hooks:15:in
eval' /home/kop/.rvm/gems/ruby-2.1.4@rails3213/bin/ruby_executable_hooks:15:in `' 任务:TOP => 资产:预编译 (通过使用 --trace 运行任务查看完整跟踪)
在我的文件配置 env=Product 中:
Rails.application.configure do
config.cache_classes = false
config.eager_load = false
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.action_mailer.raise_delivery_errors = false
config.active_support.deprecation = :log
config.active_record.migration_error = :page_load
config.assets.debug = true
config.assets.raise_runtime_errors = true
end
如何解决此错误。请帮助我 谢了。
【问题讨论】:
【参考方案1】:我通过删除 application.js 引用的空 js 文件解决了非常相似的问题
【讨论】:
【参考方案2】:欢迎来到 Stack Overflow。您的问题似乎是堆栈溢出。也就是说,你有太多的嵌套函数调用。
堆栈溢出很可能是由无意识的无限recursions 引起的。您可以在重复行上看到这一点
...
at next token (<eval>:2359:17382)
at skip_line_comment (<eval>:2359:14521)
at handle_slash (<eval>:2359:16320)
...
您必须检查,为什么它们被称为递归以及它是否适用于它们。
【讨论】:
tks,以及如何检查这个? (我是新手),请给我一个关键字搜索或任何可以修复错误 对不起,我还没有回答你的评论。虽然,你接受了答案。您还需要帮助吗?或者您可以自己解决这个问题吗?以上是关于Rails:ExecJS :: ProgramError:RangeError:超出最大调用堆栈大小的主要内容,如果未能解决你的问题,请参考以下文章
Rails:找不到 JavaScript 运行时。有关可用运行时的列表,请参阅 https://github.com/sstephenson/execjs。 (ExecJS::RuntimeUnava
Pages#home 中的 Rails ExecJS::ProgramError?
耙中止! ExecJS::RuntimeError: (execjs):1
ExecJS :: RuntimeError:SyntaxError:意外的令牌运算符