Phusion Passenger and Rails Application Using NVM Could Not Find JavaScript Runtime

I am deploying the rails application using Apache and Phusion Passenger I have already deployed the applications using this stack, but now I use NVM to install the node but when I try to load the site it shows an error, viewing the logs shows this error:

Could not find JavaScript executable. See https://github.com/rails/execjs for a list of available runtimes.

On this server I did not install nodejs from the OS repositories, and looking at the documentation for passengers, you see something about passenger_nodejs, but this is from nginx.

This is my conf from apache:

  ServerName yourserver.com

# Tell Apache and Passenger where your app 'public' directory is
DocumentRoot /var/www/myproj/public

PassengerRuby /home/appuser/.rvm/gems/ruby-2.3.0/wrappers/ruby
PassengerNodejs /home/appuser/.nvm/versions/node/v6.9.2/bin/node


# Relax Apache security settings
<Directory /var/www/myproj/public>
  Allow from all
  Options -MultiViews
  # Uncomment this if you're on Apache >= 2.4:
  Require all granted
</Directory>

and show that the error

nodejs OS repos , , node , NVM.

+4
1

, , , :

ln -sf /home/deploy/.nvm/versions/node/v6.10.1/bin/node /usr/local/bin/node

, , "" NVM "/".

+4

Source: https://habr.com/ru/post/1665806/


All Articles