I am using asdf to install ruby for a rails app. I am using nginx and passenger to serve the pages. Passenger recognizes the asdf installation of ruby, but not nodejs.
$ which node
/home/site/.asdf/shims/node
$ which ruby
/home/siite/.asdf/shims/ruby
excerpt from /etc/nginx/sites-enabled/mysite.com
passenger_enabled on;
passenger_ruby /home/site/.asdf/shims/ruby;
passenger_nodejs /home/site/.asdf/shims/node;
rails_env production;
But when I try to boot the server, I get this error:
App 18654 output: Error: The application encountered the following error: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
When I install nodejs with sudo apt-get install nodejs, everything works.
How can I use the asdf installation of nodejs to work with passenger in this fashion?
Clearly this has something to do with paths, naming or otherwise. Rather than figuring out an elaborate way to solve this, I created a symlink in /usr/local/bin
Now
which nodejsworks, and the server boots.