Hi All Because my app is running behind Apache my RoR helpers generate an incorrect url For example: http://my.website.com/xyz/users becames: http://my.webiste.com/users So I tried to set the relative path to ''xyz'' like ActionController::AbstractRequest.relative_url_root = ''/xyz'' $> ./script/server \=> Booting Mongrel (use ''script/server webrick'' to force WEBrick) => Rails 2.1.2 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... Exiting /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:279:in `load_missing_constant'': uninitialized constant ActionController (NameError) from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:468:in `const_missing'' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:480:in `const_missing'' from /srv/backend/config/environment.rb:66 from /usr/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/initializer.rb:95:in `run'' from /srv/backend/config/environment.rb:17 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in `require'' ... 23 levels... from /usr/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/commands/server.rb:39 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from ./script/server:3 thnx a lot LuCa -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Luca, I run my Rails apps behind an Apache server and don''t have that issue. It seems like your best bet would be to work on your Apache config and not your Rails config (assuming you have control over the server). You should be able to point the Apache server right to the root of your app. Post some of your Apache config if you want more help with it... --Tom On Nov 5, 10:46 am, Luca Scaljery <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi All > > Because my app is running behind Apache my RoR helpers generate an > incorrect url > > For example:http://my.website.com/xyz/users > becames: http://my.webiste.com/users > > So I tried to set the relative path to ''xyz'' like > > ActionController::AbstractRequest.relative_url_root = ''/xyz'' > > $> ./script/server > \=> Booting Mongrel (use ''script/server webrick'' to force WEBrick) > => Rails 2.1.2 application starting onhttp://0.0.0.0:3000 > => Call with -d to detach > => Ctrl-C to shutdown server > ** Starting Mongrel listening at 0.0.0.0:3000 > ** Starting Rails with development environment... > Exiting > /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:279:in > `load_missing_constant'': uninitialized constant ActionController > (NameError) > from > /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:468:in > `const_missing'' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:480:in > `const_missing'' > from /srv/backend/config/environment.rb:66 > from /usr/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/initializer.rb:95:in > `run'' > from /srv/backend/config/environment.rb:17 > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `gem_original_require'' > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `require'' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in > `require'' > ... 23 levels... > from /usr/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/commands/server.rb:39 > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `gem_original_require'' > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `require'' > from ./script/server:3 > > thnx a lot > LuCa > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
thnx for your reply! Here is the part of the apache config dealing with my mongrel cluster: RewriteRule ^/backend/(.*)$ balancer://mongrel_cluster/$1 [P,QSA,L] RewriteRule ^/rails/(.*)$ /test/current/public/$1 [PT] I think its only the first line I''m using! Furthermore I''ve plans to use to ''phusion passenger'' (apache module), maybe it will solve this problem! Also I found the following plugin: relative_path, which fixed this issue (at least I can continue now) However, I would like to fix this problem on the Apache level, if possible! Cheers LuCa TomRossi7 wrote:> Luca, > > I run my Rails apps behind an Apache server and don''t have that > issue. It seems like your best bet would be to work on your Apache > config and not your Rails config (assuming you have control over the > server). You should be able to point the Apache server right to the > root of your app. Post some of your Apache config if you want more > help with it... > > --Tom > > On Nov 5, 10:46�am, Luca Scaljery <rails-mailing-l...@andreas-s.net>-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---