找不到JavaScript运行时.看见https://github.com/rails/execjs以获取可用运行时的列



我在这台服务器上有其他rails应用程序运行良好
我在我的服务器上安装了nodejs
我的gemfile中有gem 'therubyracer', platforms: :ruby
尝试bundle install
我在产品配置中尝试config.assets.js_compressor = Uglifier.new(harmony: true)

但没有什么能解决这个错误。。。

[passenger_native_support.so] trying to compile for the current user (www-data) and Ruby interpreter...
(set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable)
Warning: compilation didn't succeed. To learn why, read this file:
/var/www/ddemarque/passenger_native_support-hxohsj.log
[passenger_native_support.so] finding downloads for the current Ruby interpreter...
(set PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY=0 to disable)
Could not download https://github.com/phusion/passenger/releases/download/release-6.0.8/rubyext-ruby-2.5.1-x86_64-linux.tar.gz: no download tool found (curl or wget required)
Trying next mirror...
Could not download https://oss-binaries.phusionpassenger.com/binaries/passenger/by_release/6.0.8/rubyext-ruby-2.5.1-x86_64-linux.tar.gz: no download tool found (curl or wget required)
Trying next mirror...
Could not download https://s3.amazonaws.com/phusion-passenger/binaries/passenger/by_release/6.0.8/rubyext-ruby-2.5.1-x86_64-linux.tar.gz: no download tool found (curl or wget required)
[passenger_native_support.so] will not be used (can't compile or download) 
--> Passenger will still operate normally.
Error: The application encountered the following error: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/execjs-2.8.1/lib/execjs/runtimes.rb:58:in `autodetect'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/execjs-2.8.1/lib/execjs.rb:5:in `<module:ExecJS>'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/execjs-2.8.1/lib/execjs.rb:4:in `<top (required)>'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/uglifier-3.2.0/lib/uglifier.rb:5:in `<top (required)>'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-2.2.15/lib/bundler/runtime.rb:66:in `block (2 levels) in require'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-2.2.15/lib/bundler/runtime.rb:61:in `each'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-2.2.15/lib/bundler/runtime.rb:61:in `block in require'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-2.2.15/lib/bundler/runtime.rb:50:in `each'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-2.2.15/lib/bundler/runtime.rb:50:in `require'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-2.2.15/lib/bundler.rb:173:in `require'
/var/www/ddemarque/config/application.rb:7:in `<top (required)>'
/var/www/ddemarque/config/environment.rb:2:in `require_relative'
/var/www/ddemarque/config/environment.rb:2:in `<top (required)>'
config.ru:3:in `require_relative'
config.ru:3:in `block in <main>'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rack-2.2.3/lib/rack/builder.rb:125:in `instance_eval'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rack-2.2.3/lib/rack/builder.rb:125:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:101:in `eval'
/usr/share/passenger/helper-scripts/rack-preloader.rb:101:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:189:in `block in <module:App>'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:390:in `run_block_and_record_step_progress'
/usr/share/passenger/helper-scripts/rack-preloader.rb:188:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'

我强制gem execjs从2.8.1降到2.7.0,它很有效。。。

最新更新