Edge Rails 3: Mongrel stuck in infinite loop, Unicorn missing uninitialized constant Rack::Runtime

Hi,

I wanted to try out Edge Rails 3 today and hit a serious problem
trying to run mongrel.

script/rails server mongrel just hangs. Interrupting and looking up
the spot of the lockup revealed

$LOAD_PATH.unshift 'projects/mongrel_experimental/lib/'
Mongrel::Gems.require 'mongrel_experimental',
">=#{Mongrel::Const::MONGREL_VERSION}"

at the bottom of mongrel.rb. This executes Mongrel::Gems.require which
contains this wonderful ($%^##&#) infinite loop:

begin
  # ActiveSupport breaks 'require' by making it always return a true
value
  Kernel.require 'rubygems'
  version ? gem(library, version) : gem(library)
  retry
rescue Gem::LoadError, LoadError, RuntimeError
  # puts "** #{library.inspect} could not be loaded" unless library ==
"mongrel_experimental"
end

Removing the two lines cited above from mongrel.rb cures the problem.
This is however not a feasible solution, since these lines are in the
system-wide mongrel gem and I don't think hacking around in these is
a good idea.

I tried Unicorn as well but it always presented me with a
`load_missing_constant': uninitialized constant Rack::Runtime
(NameError).

Does anyone have an idea how to solve this?

kind regards

Jan

Hi Jan.
I had the same problem, even with other two othes gems, and I resolved
the issue adding the gems in Gemfile and doing 'bundle install'.

the gems were:

gem "cgi_multipart_eof_fix"
gem "fastthread"
gem "mongrel_experimental"

all of them are required in mongrel.rb with sentecese like

Mongrel::Gems.require 'cgi_multipart_eof_fix' (line 16)
Mongrel::Gems.require 'fastthread' (line 17)
Mongrel::Gems.require 'mongrel_experimental' (line 355)

I don't know the diference with a normal require 'gem' statement, but I
think here is the problem.

Hope this helps.
Juan M. Cervera

Yeah, I already read that in your comment on the Rails weblog.
Thanks a lot!

With the Rails prerelease gem, Unicorn seems to be working again.

Problem solved.