ExecJS::RuntimeUnavailable after deploy

I deployed to a rails app to fly successfully but when I try to open my app link app.fly.dev, monitoring show me the follow:

Waiting for logs...

2024-01-18T06:05:14.541 app[4d89d4d9a63e58] eze [info] INFO Starting init (commit: 8995e367)...

2024-01-18T06:05:14.555 app[4d89d4d9a63e58] eze [info] INFO starting statics vsock server

2024-01-18T06:05:14.556 app[4d89d4d9a63e58] eze [info] INFO Preparing to run: `/rails/bin/docker-entrypoint ./bin/rails server` as rails

2024-01-18T06:05:14.562 app[4d89d4d9a63e58] eze [info] INFO [fly api proxy] listening at /.fly/api

2024-01-18T06:05:14.571 app[4d89d4d9a63e58] eze [info] 2024/01/18 06:05:14 listening on [fdaa:5:5a9d:a7b:268:4411:77b9:2]:22 (DNS: [fdaa::3]:53)

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] bin/rails aborted!

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/execjs-2.9.1/lib/execjs/runtimes.rb:68:in `autodetect'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/execjs-2.9.1/lib/execjs.rb:5:in `<module:ExecJS>'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/execjs-2.9.1/lib/execjs.rb:4:in `<main>'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/bootsnap-1.17.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/bootsnap-1.17.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/autoprefixer-rails-10.4.15.0/lib/autoprefixer-rails/processor.rb:4:in `<main>'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/autoprefixer-rails-10.4.15.0/lib/autoprefixer-rails.rb:39:in `require_relative'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/autoprefixer-rails-10.4.15.0/lib/autoprefixer-rails.rb:39:in `<main>'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/bootsnap-1.17.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/bootsnap-1.17.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/bootstrap-5.3.1/lib/bootstrap/engine.rb:3:in `<main>'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/bootsnap-1.17.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/bootsnap-1.17.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/bootstrap-5.3.1/lib/bootstrap.rb:61:in `register_rails_engine'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/bootstrap-5.3.1/lib/bootstrap.rb:11:in `load!'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/bootstrap-5.3.1/lib/bootstrap.rb:75:in `<main>'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /rails/config/application.rb:7:in `<main>'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /rails/Rakefile:4:in `require_relative'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /rails/Rakefile:4:in `<main>'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/railties-7.1.0/lib/rails/commands/rake/rake_command.rb:43:in `block in with_rake'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/railties-7.1.0/lib/rails/commands/rake/rake_command.rb:41:in `with_rake'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/railties-7.1.0/lib/rails/commands/rake/rake_command.rb:20:in `perform'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/railties-7.1.0/lib/rails/command.rb:156:in `invoke_rake'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/railties-7.1.0/lib/rails/command.rb:73:in `block in invoke'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/railties-7.1.0/lib/rails/command.rb:149:in `with_argv'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/railties-7.1.0/lib/rails/command.rb:69:in `invoke'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/railties-7.1.0/lib/rails/commands.rb:18:in `<main>'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/bootsnap-1.17.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] /usr/local/bundle/ruby/3.1.0/gems/bootsnap-1.17.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] ./bin/rails:4:in `<main>'

2024-01-18T06:05:15.734 app[4d89d4d9a63e58] eze [info] (See full trace by running task with --trace)

2024-01-18T06:05:16.565 app[4d89d4d9a63e58] eze [info] INFO Main child exited normally with code: 1

2024-01-18T06:05:16.565 app[4d89d4d9a63e58] eze [info] INFO Starting clean up.

2024-01-18T06:05:16.566 app[4d89d4d9a63e58] eze [info] WARN hallpass exited, pid: 307, status: signal: 15 (SIGTERM)

2024-01-18T06:05:16.571 app[4d89d4d9a63e58] eze [info] 2024/01/18 06:05:16 listening on [fdaa:5:5a9d:a7b:268:4411:77b9:2]:22 (DNS: [fdaa::3]:53)

2024-01-18T06:05:17.567 app[4d89d4d9a63e58] eze [info] [ 3.287956] reboot: Restarting system

2024-01-18T06:05:17.660 runner[4d89d4d9a63e58] eze [info] machine did not have a restart policy, defaulting to restart

2024-01-18T06:05:51.470 app[4d89d4d9a63e58] eze [info] [ 0.044746] PCI: Fatal: No config space access function found

2024-01-18T06:05:51.689 app[4d89d4d9a63e58] eze [info] INFO Starting init (commit: 8995e367)...

2024-01-18T06:05:51.703 app[4d89d4d9a63e58] eze [info] INFO starting statics vsock server

2024-01-18T06:05:51.704 app[4d89d4d9a63e58] eze [info] INFO Preparing to run: `/rails/bin/docker-entrypoint ./bin/rails server` as rails

Try

bin/rails generate dockerfile

I’m assuming that you are using the dockerfile that rails provided you. It likely needs to be updated.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.