Centos

CentOS 升級後 Ruby/Mongrel 安裝中斷,伺服器無法啟動

  • April 22, 2013

我認為我之前的問題表述得有些糟糕。

我遇到了一個執行 ruby​​ 的 CentOS 系統和一個在作業系統更新後失敗的混合伺服器的問題。

編輯:最初的問題已經消失。但是啟動伺服器仍然無法正常工作:

./script/server
/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require': iconv will be deprecated in the future, use String#encode instead.
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails 2.2.2 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:142:in `load': cannot load such file -- mongrel_rails (LoadError)
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:142:in `block in load_with_new_constant_marking'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:142:in `load_with_new_constant_marking'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rails-2.2.2/lib/commands/servers/mongrel.rb:64:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rails-2.2.2/lib/commands/server.rb:49:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from ./script/server:3:in `<main>'

Rails 2.2.2 是應用程序所要求的。我知道它已經過時了,但現在我只想讓那個東西再次執行,然後再為升級而煩惱。

嘗試安裝 mongrel 如下所示:

gem install mongrel
Building native extensions.  This could take a while...
ERROR:  Error installing mongrel:
ERROR: Failed to build gem native extension.

   /usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb
checking for main() in -lc... yes
creating Makefile

make
compiling http11_parser.c
http11_parser.rl: In Funktion »http_parser_execute«:
http11_parser.rl:105: Warnung: Vergleich zwischen vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken
compiling http11.c
http11.c: In Funktion »http_field«:
http11.c:77: Fehler: »struct RString« hat kein Element namens »ptr«
http11.c:77: Fehler: »struct RString« hat kein Element namens »len«
http11.c:77: Warnung: linker Operand des Komma-Ausdrucks hat keinen Effekt
http11.c: In Funktion »header_done«:
http11.c:172: Fehler: »struct RString« hat kein Element namens »ptr«
http11.c:172: Fehler: »struct RString« hat kein Element namens »ptr«
http11.c:172: Fehler: »struct RString« hat kein Element namens »ptr«
http11.c:174: Fehler: »struct RString« hat kein Element namens »ptr«
http11.c:176: Fehler: »struct RString« hat kein Element namens »ptr«
http11.c:177: Fehler: »struct RString« hat kein Element namens »len«
http11.c: In Funktion »HttpParser_execute«:
http11.c:298: Fehler: »struct RString« hat kein Element namens »ptr«
http11.c:299: Fehler: »struct RString« hat kein Element namens »len«
make: *** [http11.o] Fehler 1


Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p392/gems/mongrel-1.1.5 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p392/gems/mongrel-1.1.5/ext/http11/gem_make.out

Mongrel 與 Ruby > 1.9.1 不兼容,並且也不再維護。你真的不應該使用它。

您的選擇是:

  1. 切換到另一台伺服器。Thin 是通常推薦的繼任者,因為它基於 mongrel。(可能是您最好的選擇。)
  2. 使用變通方法強制 Mongrel 進行編譯。不過,這並不能保證它會真正起作用……

引用自:https://serverfault.com/questions/501476