2012-12-01 58 views
1

斷開連接時,乘客+ nginx失敗我使用乘客安裝的Ubuntu 12.04 LTS,rvm,passenger和nginx。 我用Putty連接到我的服務器,通過init.d/nginx啓動nginx,我的Rails應用程序運行良好。當我從終端

但是,當我從終端斷開,我看到標準的應用程序錯誤(出現問題等)。

Nginx的錯誤日誌輸出:

<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- rubygems (LoadError) 
    from <internal:lib/rubygems/custom_require>:29:in `require' 
    from <internal:gem_prelude>:167:in `load_full_rubygems_library' 
    from <internal:gem_prelude>:217:in `try_activate' 
    from <internal:lib/rubygems/custom_require>:32:in `rescue in require' 
    from <internal:lib/rubygems/custom_require>:29:in `require' 
    from /var/lib/passenger-standalone/3.0.18-x86_64-ruby1.9.3-linux-gcc4.6.3-1002/support/helper-scripts/passenger-spawn-server:75:in `<main>' 
*** Passenger ERROR (ext/common/ApplicationPool/../SpawnManager.h:220): 
Could not start the spawn server: /home/torteg/.rvm/wrappers/ruby-1.9.2-p320/ruby: No such file or directory (2) 
*** Passenger ERROR (ext/common/ApplicationPool/../SpawnManager.h:220): 
Could not start the spawn server: /home/torteg/.rvm/wrappers/ruby-1.9.2-p320/ruby: No such file or directory (2) 

PS AUX輸出:

root  5066 0.0 0.0 220928 1936 ?  Ssl 15:46 0:00 PassengerWatchdog 
root  5069 0.0 0.0 1872956 2340 ?  Sl 15:46 0:00 PassengerHelperAgent 
root  5071 0.5 0.2 114348 10172 ?  Sl 15:46 0:00 Passenger spawn server 
nobody 5074 0.0 0.1 169324 4688 ?  Sl 15:46 0:00 PassengerLoggingAgent 
root  5105 0.0 0.0 39472 1028 ?  Ss 15:46 0:00 nginx: master process /opt/nginx/sbin/nginx 
torteg 5106 0.0 0.0 39892 2276 ?  S 15:46 0:00 nginx: worker process 
torteg 5116 13.2 1.5 225720 62432 ?  Sl 15:46 0:03 Passenger ApplicationSpawner: /webapps/ngt-storage 
torteg 5132 2.4 1.5 230940 64520 ?  Sl 15:46 0:00 Rack: /webapps/ngt-storage 
root  5141 0.1 0.1 160656 7272 ?  Ss 15:47 0:00 sshd: torteg [priv] 
torteg 5145 0.0 0.0 164168 1820 ?  S 15:47 0:00 sshd: torteg [priv] 
torteg 5291 0.0 0.0 160656 2656 ?  S 15:47 0:00 sshd: [email protected]/3 
+0

新聞: 使用默認的bash shell創建新用戶'deploy'。爲此用戶安裝了rvm。然後我將用戶和passenger_user設置爲在nginx.conf中配置。清理預編譯資產..運行良好! –

回答

1

創建新用戶部署使用默認bash shell。爲此用戶安裝了rvm。然後我在nginx.conf中將user和passenger_user設置爲deploy。清理預編譯資產..運行良好!

1

所以,當你在世界ssh到生產服務器,其他地方(或雲)你參觀mydomain.com它的工作原理。只要你退出該SSH連接,nginx和乘客停止工作?這兩個獨立事件是如何相互關聯的? 你用什麼服務來託管這個應用程序?

我看你使用RVM太...除非RVM路徑未在部署用戶設置(只是想大聲) 可能的答案(當你的答案我們將清理這件事)

+0

只要您退出該ssh連接,nginx和乘客就會停止工作? - 立即。我使用自己的服務器。 torteg - 是我的用戶,它在nginx.conf中。我爲torteg用戶安裝了rvm。 –

+0

你有沒有在ssh中設置一些奇怪的設置,關閉所有東西,只有當你ssh進入時纔會出現? LIKE也關閉了其他東西嗎? – pjammer

+0

只有乘客下降。 Nginx運行良好。 –