2012-03-02 49 views
0

我在使用簡單的Rails應用程序上的瘦服務器方面很新穎。它的工作很好,除了,有一成的4倍以下,當我去到應用中的任何頁面我得到這個瀏覽器:通過簡單的Rails應用程序使用瘦服務器時在日誌中出現意外錯誤

Status: 500 Internal Server Error Content-Type: text/html 
Application error 

Change this error message for exceptions thrown outside of an action (like in Dispatcher   setups or broken Ruby code) in public/500.html 

,這在日誌中:

Processing PlansController#index (for 24.61.84.158 at 2012-03-02 17:53:48) [GET] 
    Session ID: 3105294042126eab3c6292d3ba224847 
    Parameters: {"controller"=>"plans", "action"=>"index"} 
Rendering layoutfalseactionlist within layouts/standard 
Rendering plans/list 
Completed in 0.18974 (5 reqs/sec) | Rendering: 0.10813 (56%) | DB: 0.03900 (20%) | 200 OK [http://admin.blogbridge.com/] 
file /tmp/ruby_sess.5684ebd33a502d9d not readable 
/usr/local/rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/pstore.rb:100:in `initialize' 
/usr/local/rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/cgi/session/pstore.rb:61:in `new' 
/usr/local/rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/cgi/session/pstore.rb:61:in `initialize' 
/usr/local/rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/cgi/session.rb:280:in `new' 
/usr/local/rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/cgi/session.rb:280:in `initialize' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/cgi_process.rb:123:in `new' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/cgi_process.rb:123:in `session' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/cgi_process.rb:155:in `stale_session_check!' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/cgi_process.rb:110:in `session' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/base.rb:1052:in `assign_shortcuts_without_flash' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/flash.rb:140:in `assign_shortcuts' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/base.rb:424:in `process_without_filters' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/filters.rb:624:in `process_without_session_management_support' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/session_management.rb:114:in `process' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/base.rb:330:in `process' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/rails-1.2.3/lib/dispatcher.rb:41:in `dispatch' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/rack/adapter/rails.rb:89:in `call' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/rack/adapter/rails.rb:69:in `call' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/connection.rb:80:in `pre_process' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/connection.rb:78:in `catch' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/connection.rb:78:in `pre_process' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/connection.rb:53:in `process' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/connection.rb:38:in `receive_data' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/backends/base.rb:61:in `start' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/server.rb:159:in `start' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/controllers/controller.rb:86:in `start' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/runner.rb:185:in `send' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/runner.rb:185:in `run_command' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/runner.rb:151:in `run!' 
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/bin/thin:6 
/usr/local/rvm/gems/ruby-1.8.7-p357/bin/thin:19:in `load' 
/usr/local/rvm/gems/ruby-1.8.7-p357/bin/thin:19 

有沒有人見過這個?

+0

更多解決方案的解決方法,但考慮使用會話的memcache存儲,這有利於更具可伸縮性,更快速並且有避免此問題的良機。順便說一下,你有分佈式架構,還是關於這個文件系統的特別之處? – 2012-03-03 04:29:13

+0

謝謝..但不,這是一個相當香草的設置。在Linode的Linux機器上運行Centos。只是嘗試通過Apache虛擬域啓動瘦服務器。任何其他想法? – pitosalas 2012-03-03 13:29:41

回答

1

對我來說,堅持的是rails-1.2.3在你的堆棧中。我相信如果你bundle exec thin你會得到正確版本的rails,但你也可以通過刪除所有不依賴於你的應用的gem來強制這個。雖然rvm非常適合開發,但我並不認爲它在系統級別安裝時帶來了很多價值,而且我聽到很多人在生產系統(尤其是CentOS)上掙扎着獲取環境正確無誤地運行用戶精簡。如果您不熟悉rails部署,請考慮使用像passenger這樣的東西,並且只需要依賴關係。

相關問題