[Mongrel] Mongrel service keeps re-starting ruby

Michael Pliskin mike at comapping.com
Fri Jun 26 05:48:15 EDT 2009


Hi Jonathan,

Thanks a million, your fix worked like a charm! Everything is ok now. Thanks again for fast and superb response!

Mike

-----Original Message-----
From: mongrel-users-bounces at rubyforge.org [mailto:mongrel-users-bounces at rubyforge.org] On Behalf Of Jonathan Rochkind
Sent: Thursday, June 25, 2009 6:08 PM
To: mongrel-users at rubyforge.org
Subject: Re: [Mongrel] Mongrel service keeps re-starting ruby

Ah, actually reading your stack trace, I see it is indeed the --prefix 
and modern versions of Rails issue.  I still don't know why that 
consumes all CPU instead of just reporting an error.

But mongrel is trying to call a method that no longer exists in RAils 
2.3 like you have. (I think it dissappeared in Rails 2.2, but could be 
wrong, it's definitely gone in Rails 2.3).

Try dropping this file in your app's config/initializers directory, to 
basically restore the method that mongrel is trying to call, as a 
wrapper for the new way to trigger this functionality.

config/initializers/patch_for_mongrel.rb  [name of file can be anything]

# Fix for mongrel which still doesn't know about Rails 2.2's changes, grr.
# We provide a backwards compatible wrapper around the new 
ActionController::base.relative_url_root,
# so it can still be called off of the actually non-existing 
AbstractRequest class.

module ActionController
  class AbstractRequest < ActionController::Request
    def self.relative_url_root=(path)
      ActionController::Base.relative_url_root=(path)
    end
    def self.relative_url_root
      ActionController::Base.relative_url_root
    end
  end
end

Michael Pliskin wrote:
> Dear Luis,
>
> Thanks a lot for replying, I followed your advice and it revealed the problem: it was the --prefix switch that caused it. When I start it like
> E:\RailsApps\3vi>mongrel_rails start -e development -p 3001 -a 127.0.0.1 -l "e:/RailsApps/3vi/log/1.log" -P "e:/RailsApps/3vi/log/mongrel.pid" -t 0 -r "public" -n 1024 --prefix "/labelyzer"
> I am given a ton of errors:
> ** Starting Mongrel listening at 127.0.0.1:3001
> ** Starting Rails with development environment...
> ** Mounting Rails at /labelyzer...
> D:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant ActionController::AbstractRequest (NameError)
>         from D:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing'
>         from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/rails.rb:151:in `rails'
>         from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:113:in `cloaker_'
>         from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:149:in `call'
>         from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:149:in `listener'
>         from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:99:in `cloaker_'
>         from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:50:in `call'
>         from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:50:in `initialize'
>         from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:84:in `new'
>         from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:84:in `run'
>         from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/command.rb:212:in `run'
>         from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:281
>         from D:/Ruby/bin/mongrel_rails:19:in `load'
>         from D:/Ruby/bin/mongrel_rails:19
>
> And if I skip --prefix, it's all fine. Any ideas?
>
> Thanks in advance,
>  Mike
>
> -----Original Message-----
> From: mongrel-users-bounces at rubyforge.org [mailto:mongrel-users-bounces at rubyforge.org] On Behalf Of Luis Lavena
> Sent: Thursday, June 25, 2009 4:20 PM
> To: mongrel-users at rubyforge.org
> Subject: Re: [Mongrel] Mongrel service keeps re-starting ruby
>
> On Thu, Jun 25, 2009 at 2:07 AM, Michael Pliskin<mike at comapping.com> wrote:
>   
>> Hi all,
>>
>>
>>
>> Some disclaimer first: I am a complete newbie in mongrel and this list, so
>> please forgive me if I say something weird. I have a problem, I've googled
>> for a solution for quite a while and failed so far, so decided to ask here.
>>
>>
>>
>> I am trying to set up my Rails application on Windows according to this
>> manual:
>> http://nlakkakula.wordpress.com/2008/11/24/10-steps-for-deploying-your-ruby-on-rails-application-on-a-windows-server-2008-apache-mongrel-cluster/
>> . Everything is ok however when I completed all the steps, Apache complains
>> that it cannot contact proxy - meaning there is something wrong with
>> mongrel. I digged further and found mongrel keeping re-starting the ruby
>> process. If I look into a task manager, the picture is like:
>>
>> -          A ruby.exe process is started
>>
>> -          It eats 100% CPU for 5 seconds
>>
>> -          It also eats about 25MB RAM
>>
>> -          It dies then
>>
>> And the process repeats forever. It looks like there is some error happening
>> but I don't know any way to capture it.
>>
>>
>>
>> My OS is Win2k Advanced Server SP4. Any ideas?
>>
>>
>>
>> Thanks,
>>
>>   Mike Pliskin
>>
>>     
>
> That behavior is normal with mongrel_service. has been implemented in
> a way that the ruby process automatically restart in case of a
> failure, which is seems is happening in the background.
>
> To debug this, please start mongrel standalone:
>
> cd my_app
> mongrel_rails start
>
> Doing that, you should see, on the console, what is happening.
>
> Please paste the results on your reply so I can help you out.
>
> Cheers,
> --
> Luis Lavena
> AREA 17
> -
> Perfection in design is achieved not when there is nothing more to add,
> but rather when there is nothing more to take away.
> Antoine de Saint-Exupéry
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users
>
>   
_______________________________________________
Mongrel-users mailing list
Mongrel-users at rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-users


More information about the Mongrel-users mailing list