0

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
Lars
  • 113
  • 4
  • The top message in your error is unable to find "mongrel_rails" library. You should check to make sure that library is installed. Often I've seen this because I am using the wrong version of ruby/gems on a system (that has a few) or haven't installed enough gems yet. See if the rpms or gems for mongrel (and all of rails) are installed and doublecheck your ruby / gems versions? – adric Apr 22 '13 at 11:40
  • So I made sure mongrel is there, its the pre-release version, but anyway, same error. I'm not exactly sure what's missing there. – Lars Apr 22 '13 at 14:11

1 Answers1

0

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...
Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • Yes I now tried that way. Switched to passenger. Right now my problem is that it throws an error because the ruby version is to new: `undefined method 'path' for class 'ActionController::UploadedStringIO'` and in the backtrace `/usr/local/rvm/gems/ruby-1.9.3-p392/gems/actionpack-2.2.2/lib/action_controller/request.rb`. Rather weird, because `which ruby`clearly says `/usr/local/rvm/rubies/ruby-1.8.7-p371/bin/ruby` – Lars Apr 22 '13 at 16:31
  • Okay I managed. Had to remove all other ruby versions in order to ensure it's using the correct 1.8.7 one. – Lars Apr 22 '13 at 17:21