2014-02-15 148 views
0

我試過了解我所知道的所有信息,並在堆棧和谷歌上查找上下。在Raspberry Pi上運行Rails的問題

我使用raspbian與apache2/passenger4.0.37 Ruby 2.1.0 Rails 4.0.2。

當我嘗試加載我的地​​盤我得到一個500錯誤,當我檢查Apache日誌我有

/usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require': cannot load such file -- /phusion_passenger/platform_info/operating_system (LoadError) 
     from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require' 
     from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require' 
     from /usr/local/rvm/gems/ruby-2.1.0/gems/passenger-4.0.37/lib/phusion_passenger.rb:233:in `require_passenger_lib' 
     from /usr/local/rvm/gems/ruby-2.1.0/gems/passenger-4.0.37/lib/phusion_passenger/native_support.rb:68:in `libext' 
     from /usr/local/rvm/gems/ruby-2.1.0/gems/passenger-4.0.37/lib/phusion_passenger/native_support.rb:81:in `library_name' 
     from /usr/local/rvm/gems/ruby-2.1.0/gems/passenger-4.0.37/lib/phusion_passenger/native_support.rb:214:in `compile_and_load' 
     from /usr/local/rvm/gems/ruby-2.1.0/gems/passenger-4.0.37/lib/phusion_passenger/native_support.rb:49:in `start' 
     from /usr/local/rvm/gems/ruby-2.1.0/gems/passenger-4.0.37/lib/phusion_passenger/native_support.rb:376:in `<top (required)>' 
     from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require' 
     from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require' 
     from /usr/share/phusion-passenger/helper-scripts/passenger-spawn-server:79:in `<main>' 
[ pid=8453 thr=3069558784 file=ext/apache2/Hooks.cpp:862 time=2014-02-14 19:47:12.154 ]: Unexpected error in mod_passenger: Cannot spawn application '/var/www/gobles': Could not read from the spawn server: Connection reset by peer (104) 
    Backtrace: 
    in 'virtual Passenger::SessionPtr Passenger::ApplicationPool::Client::get(const Passenger::PoolOptions&)' (Client.h:742) 
    in 'Passenger::SessionPtr Hooks::getSession(const Passenger::PoolOptions&)' (Hooks.cpp:294) 
    in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:563) 

有在Ruby應用程序沒有日誌文件。

任何幫助,將不勝感激。感謝:D

因爲我們在權限錯誤的路徑只是想我會分享。

ps aux | grep -i apache 

息率

root  9457 0.0 1.7 36584 7984 ?  Ss 11:13 0:00 /usr/sbin/apache2 -k start 
www-data 9493 0.0 1.2 36836 5696 ?  S 11:13 0:00 /usr/sbin/apache2 -k start 
www-data 9494 0.0 1.0 36616 4528 ?  S 11:13 0:00 /usr/sbin/apache2 -k start 
www-data 9495 0.0 1.2 36836 5696 ?  S 11:13 0:00 /usr/sbin/apache2 -k start 
www-data 9496 0.0 1.0 36616 4512 ?  S 11:13 0:00 /usr/sbin/apache2 -k start 
www-data 9497 0.0 1.0 36616 4512 ?  S 11:13 0:00 /usr/sbin/apache2 -k start 
www-data 9499 0.0 1.0 36616 4512 ?  S 11:13 0:00 /usr/sbin/apache2 -k start 

和乘客

root  9460 0.0 0.3 4420 1712 ?  Ssl 11:13 0:00 PassengerWatchdog 
root  9467 0.0 0.5 13376 2272 ?  Sl 11:13 0:00 PassengerHelperAgent 
nobody 9478 0.0 0.7 11060 3212 ?  Sl 11:13 0:00 PassengerLoggingAgent 

,並在我的應用程序

drwxr-xr-x 8 root root 4096 Feb 14 18:30 app 
drwxr-xr-x 2 root root 4096 Feb 14 18:30 bin 
drwxr-xr-x 5 root root 4096 Feb 14 18:30 config 
-rwxr-xr-x 1 root root 154 Feb 14 18:30 config.ru 
drwxr-xr-x 2 root root 4096 Feb 14 18:30 db 
-rwxr-xr-x 1 root root 1187 Feb 14 18:51 Gemfile 
-rwxr-xr-x 1 root root 2844 Feb 14 18:52 Gemfile.lock 
-rwxr-xr-x 1 root root 1187 Feb 14 22:59 Gemfile.save 
drwxr-xr-x 4 root root 4096 Feb 14 18:30 lib 
drwxr-xr-x 2 root root 4096 Feb 14 19:42 log 
drwxr-xr-x 2 root root 4096 Feb 14 18:30 public 
-rwxr-xr-x 1 root root 251 Feb 14 18:30 Rakefile 
-rwxr-xr-x 1 root root 478 Feb 14 18:30 README.rdoc 
drwxr-xr-x 8 root root 4096 Feb 14 18:30 test 
drwxr-xr-x 3 root root 4096 Feb 14 18:30 tmp 
drwxr-xr-x 3 root root 4096 Feb 14 18:30 vendor 

一眼我試過CHOWN WWW的數據:WWW的數據那裏也沒有運氣。

+0

此問題可能會提供有用的信息http://stackoverflow.com/questions/9894939/cannot-spawn-application – OneChillDude

回答

0

因此,似乎基於這個問題Cannot spawn application,問題是乘客用戶沒有權限運行rails應用程序。

您可以通過查看日誌文件

Cannot spawn application '/var/www/gobles': Could not read from the spawn server: Connection reset by peer (104). 

有一兩件事你可以嘗試做出來,是查不到乘客的用戶名是什麼,然後在/var/www/gobles目錄做一個chmod -R

+0

通讀您的鏈接,並嘗試在應用程序目錄上的chmod -R 755。仍然得到相同的錯誤。我也試過[鏈接](http://www.modrails.com/documentation/Users%20guide%20Apache.html#_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_perve_permission_to_execute_it),但這似乎並沒有工作,我一直在「不能將部分上下文應用於無標籤文件「我做了一些研究,但所有其他建議似乎也沒有工作。 – squeegy

+0

你能發佈更新的錯誤跟蹤和信息嗎? – OneChillDude

+0

你在找什麼。我在linux中並不擅長。以上仍然是我得到的錯誤。/var/log/messages中沒有任何內容。和/ var/www/gobles/log也沒有。 – squeegy

相關問題