Ruby/Mongrel installation broken after CentOS upgrade, server won't start

Lars asked:

I think my previous questions was somewhat badly formulated.

I’ve got an issue with a CentOS system that is running ruby and a mongrel server which failed after an OS update.

Edit: The initial issues are gone. But starting a server still just won’t work:

./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 is what the application asks for. I know it’s horribly old, but for now I just want that thing to run again, before bothering with upgrades.

Trying to install mongrel looks like this:

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

My answer:


Mongrel isn’t compatible with Ruby > 1.9.1, and it’s also no longer maintained. You really should not be using it.

Your options are:

  1. Switch to another server. Thin is the usual recommended successor, since it’s based on mongrel. (Probably your best option.)
  2. Use a workaround to force Mongrel into compiling. This doesn’t guarantee it will actually work, though…

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.