gpt4 book ai didi

javascript - ExecJS 运行时错误

转载 作者:搜寻专家 更新时间:2023-11-01 00:11:16 24 4
gpt4 key购买 nike

我已经在 ubuntu 12.04 服务器上安装了 nodejs,我想知道为什么我在编译 Assets 时遇到问题,当我转到控制台 rails c 我运行这个

ExecJS::Runtimes.best_available=> #<ExecJS::ExternalRuntime:0x0000000118cc88
@binary="nodejs",
@command=["nodejs", "node"],
@deprecated=false,
@encoding="UTF-8",
@name="Node.js (V8)",
@runner_path= "/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/execjs-1.4.0/lib/execjs/support/node_runner.js",

@test_args=无, @test_match=nil>

当然我可以运行 nodenodejs 命令,可能有什么问题,这是尝试编译 Assets 后的错误

/home/bonsai/.rvm/rubies/ruby-1.9.3-p392/bin/ruby /home/bonsai/.rvm/gems/ruby-1.9.3-p392@global/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
Killed

(in /home/bonsai/bonsaierp/app/assets/javascripts/application.js.coffee)
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:142:in `exec_runtime'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:28:in `block in exec'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:41:in `compile_to_tempfile'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:27:in `exec'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/uglifier-1.3.0/lib/uglifier.rb:100:in `compile'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/actionpack-3.2.13/lib/sprockets/compressors.rb:74:in `compress'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/processing.rb:265:in `block in js_compressor='
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/processor.rb:29:in `call'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/processor.rb:29:in `evaluate'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/tilt-1.3.6/lib/tilt/template.rb:77:in `render'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/context.rb:193:in `block in evaluate'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `each'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `evaluate'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/bundled_asset.rb:26:in `initialize'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `new'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `build_asset'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/index.rb:93:in `block in build_asset'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/caching.rb:19:in `cache_asset'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/index.rb:92:in `build_asset'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/base.rb:169:in `find_asset'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/index.rb:60:in `find_asset'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/actionpack-3.2.13/lib/sprockets/static_compiler.rb:19:in `block in compile'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/base.rb:219:in `block in each_logical_path'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/base.rb:206:in `block (2 levels) in each_file'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each_entry'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/base.rb:204:in `block in each_file'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each_file'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/sprockets-2.2.2/lib/sprockets/base.rb:217:in `each_logical_path'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/actionpack-3.2.13/lib/sprockets/static_compiler.rb:18:in `compile'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/actionpack-3.2.13/lib/sprockets/assets.rake:56:in `internal_precompile'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/actionpack-3.2.13/lib/sprockets/assets.rake:70:in `block (3 levels) in <top (required)>'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/actionpack-3.2.13/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
Tasks: TOP => assets:precompile:primary
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/home/bonsai/.rvm/rubies/ruby-1.9.3-p392/b...]
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/actionpack-3.2.13/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/actionpack-3.2.13/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/gems/actionpack-3.2.13/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/bin/ruby_noexec_wrapper:14:in `eval'
/home/bonsai/.rvm/gems/ruby-1.9.3-p392@rails3.2/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

最佳答案

我在使用 Digital Ocean 时也遇到了同样的问题。我假设您使用的是 512MB 的 Droplet。我给他们发了一张支持票,这是他们的回复:

“通常,在 512MB 的 droplet 上运行 Nginx、Unicorn 和 Ruby on Rails,您会遇到内存问题。我建议考虑升级到 1GB 的 Droplet,并设置 1GB 的交换内存。”

请注意,在使用 512MB droplet 时,我仍然尝试设置 1GB 交换内存,因为我没有在服务器上设置交换内存,但这实际上产生了相同的错误。当我听从他/她的建议并升级到 1GB droplet 时,编译 Assets 工作正常。

关于javascript - ExecJS 运行时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15552671/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com