Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)

question

#1

I have deployed the rails after burn application to AWS Lamda and it successfully deployed but he the endpoint is returning timeout message:
{
* message: “Endpoint request timed out”
}
The URl I get is: https://2yne7fyus8.execute-api.us-east-1.amazonaws.com/prod/

After checking the logs I get these errors:

/opt/ruby/gems/2.5.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect’: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)

I have even moved uglifier and coffee-rails gems to development group but still getting same error.


#2

See:

The first link mentions:

Try going up farther in the CloudWatch logs and see if you can find an error about rackup failing to start. That is the key. Was able to just deploy the tongueroo/demo-rails-api 1 app with Jets Afterburner mode successfully. So, at this point think it’s project specific issue :face_with_monocle: Try to go farther up the CloudWatch logs to find out where rackup is failing to start.

Jets starts the rack server during the cold start for performance. So you have to find the request with the cold start.

Also, just deployed the https://github.com/tongueroo/demo-rails app and it was ok. It may be specific to your setup :face_with_monocle: Would also try spinning up a cloud9 machine and deploying the demo-app from there. That may help eliminate specific setup issues.