我使用Apache和Phusion Passenger部署Rails應用程序 我已經使用此堆棧部署應用程序,但現在我正在使用NVM安裝節點 但是當我嘗試加載站點顯示錯誤,查看日誌顯示此錯誤:使用NVM的Phusion Passenger和Rails應用程序找不到JavaScript運行時
找不到JavaScript運行時。有關可用運行時的列表,請參閱https://github.com/rails/execjs。
在這臺服務器上,我沒有從操作系統倉庫安裝nodejs,並且在乘客文檔上查看了一些關於passenger_nodejs的內容,但是這是來自nginx。
這是Apache我的conf:
服務器名yourserver.com
# Tell Apache and Passenger where your app's '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>
,並保持顯示出錯誤
從OS回購安裝固定的NodeJS消息和應用程序的作品,但是因爲它使用了操作系統的節點版本,但我想使用NVM版本。
保存了我的一天。謝謝 – Batbayar