1

I have installed a rails app with ginx/1.14.0 and passenger/6.0.6 in a Ubuntu 18.04.5. (nodejs installed with apt install nodejs). But I have to change nodejs and install with nvm. The rails app was down and I got this in the log:

... The application encountered the following error: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. ...

I set passenger_nodejs /home/<user>/.nvm/versions/node/v14.15.0/bin/node; and nothing. I set on location section and http section, after and befor passenger_ruby and nothing.

The only solution was with a ln link like https://stackoverflow.com/a/42967056/2144445 but I think this is not the best solution because What if someone change the ln

I do not know what I have missing can anyone help me. Thx

inye
  • 1,786
  • 1
  • 23
  • 31

1 Answers1

0

I am not familiar with passenger, but I had a similar problem with foreman. I ended up running my application using nvm exec like this:

. ~/.nvm/nvm.sh
nvm exec foreman start

I suppose you could replace foreman start with any other command you are using.

Matt
  • 5,328
  • 2
  • 30
  • 43