Starting a rails console session fails

Trying to run fly ssh console --pty -C 'sudo -iu rails' and then bin/rails console results in

/rails/vendor/bundle/ruby/2.7.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect': Could not find a JavaScript runtime. See for a list of available runtimes. (ExecJS::RuntimeUnavailable)

I can’t seem to get a rails console session started and none of the documented methods work.

Run the following command before bin/rails console:

export PATH=/usr/local/node/bin:$PATH

I’ve opened Adjust PATH when `--sudo` is specified · Issue #37 · rubys/dockerfile-rails · GitHub to track fixing this.

Still running into an issue of the session hanging and no response.

Do the logs show anything? A common error is out of memory.

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