Problem when migrating from rails 2.2.2 to rails 2.3.2 on linux SLES10 + apache 2


#1

When I do this migration and I want to launch mongrel_cluster
(mongrel_rails cluster::start), I get an error :
** Starting Mongrel listening at 127.0.0.1:3010
** Starting Rails with production environment…
** Mounting Rails at /test…
/usr/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)

No plugins. It’s just a basic rails app showing only the standard
index page.

Thanks for your help if someone has an idea.


#2

On Apr 8, 10:16 pm, Madchipset removed_email_address@domain.invalid wrote:

index page.

Definitely sounds like a plugin or monkey patch issue to me -
AbstractRequest was a class that disappeared in rails 2.3. I’d start
by searching your code for that and see what comes up.

Fred


#3

Thanks a lot for your reply Fred. First, I checked with my app : I
started it fine without the cluster (script/server -e production) and
it worked nice. Then I created a basic app without any plugin (rails
test), showing only the standard page Welcome aboard. Again it worked
fine without the cluster. When I create it (mongrel_rails
cluster::configure -e production -p 3010 -N 2 -c /my/path/test -a
127.0.01 --prefix /test) and launch it (mongrel_rails cluster::start)
then I get the error reported in log/mongrel.3010.log. So wouldn’it be
mongrel_cluster which causes the problem ?


#4

On Apr 9, 6:17 pm, Madchipset removed_email_address@domain.invalid wrote:

Thanks a lot for your reply Fred. First, I checked with my app : I
started it fine without the cluster (script/server -e production) and
it worked nice. Then I created a basic app without any plugin (rails
test), showing only the standard page Welcome aboard. Again it worked
fine without the cluster. When I create it (mongrel_rails
cluster::configure -e production -p 3010 -N 2 -c /my/path/test -a
127.0.01 --prefix /test) and launch it (mongrel_rails cluster::start)
then I get the error reported in log/mongrel.3010.log. So wouldn’it be
mongrel_cluster which causes the problem ?

Did you try a newer version of mongrel ?

Fred


#5

I’m using mongrel (1.1.5) and mongrel_cluster (1.0.5) which seem to be
the last versions. I got a bit deeper in the bug analysis. It’s a bit
trickiest than I first thought. In fact, I have in my cluster config
file (config/mongrel_cluster.yml) a line : prefix: /my_app_name. If I
delete this line, the cluster will start alright and I have no more
errors ! But I need this line so that in my apache conf file, I use
the <Proxy balancer://my_app_name> line and the rewrite line
(RewriteRule ^/my_app_name(.*)$ balancer://my_app_name%{REQUEST_URI}
[P,QSA,L]).

It used to work perfectly when I was in rails 2.2.2

Any idea ?

Thanks anyway for your kind help.


#6

On Apr 10, 2:44 pm, Madchipset removed_email_address@domain.invalid wrote:

It used to work perfectly when I was in rails 2.2.2
Ah - mongrel does

    ActionController::AbstractRequest.relative_url_root = ops

[:prefix] if ops[:prefix]

if :prefix is set.

These days I think you just set on
ActionController::Base.relative_url_root

Give that that’s all the prefix option seems to do, you could not pass
it to mongrel and set it in your app’s environment

Fred


#7

I finally got the solution on the web… Thanks to P. Leonhardt and C
Nolte posts. Here is the workaround :

Copy this file in my_rails_app/config/initializers :

abstract_request.rb

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

Hope this may help someone else.

Thanks again, my server is working fine now.


#8

Hi,

Thanks, it solved my problem. Although it looks like a hack to me. Isn’t
this a bug in mongrel_service? Should we report it?

As of today I am using Ruby 1.8.7, Rail 2.3.5 and Rubygems 1.3.5. As for
Mongrel: mongrel (1.1.5) and mongrel_service (0.3.4) and the problem
still
exists.

View this message in context:
http://old.nabble.com/Problem-when-migrating-from-rails-2.2.2-to-rails-2.3.2-on-linux--SLES10-%2B-apache-2-tp22961256p27465916.html
Sent from the RubyOnRails Users mailing list archive at Nabble.com.


#9

I have 2 rails apps on that server. I didn’t get from your answer what
I shall do on the apache conf file and what I shall do on my rails’
apps (and in what file : environment.rb ?)

Thanks.

On Apr 10, 4:56 pm, Frederick C. removed_email_address@domain.invalid