Problem with Passenger only when deploying to subURI

184 views
Skip to first unread message

WebPain

unread,
Nov 28, 2008, 10:11:46 PM11/28/08
to Phusion Passenger Discussions
Hi all,

when i set the documentRoot to point to the /blah/www/rails/testapp/
public folder everythings fine,

but then i set the documentRoot to /blah/www, created a symlink in
that folder pointing to /blah/www/rails/testapp/public and its been
driving me mad the past 2 hours trying to figure out what the heck is
wrong.

apache's error.log says:
ActionController::RoutingError (No route matches "/testapp" with
{:method=>:get}):
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/
routing/recognition_optimisation.rb:66:in `recognize_path'

and by the way the symling does point to the public folder.

Any further suggestions would be welcome!

Thanks

Pain

WebPain

unread,
Nov 28, 2008, 10:18:11 PM11/28/08
to Phusion Passenger Discussions
Also...

a) gem install rails <- did that

b) upgrade RAILS_ENV to 2.2.2 <- u probably mean RAILS_GEM_VERSION =
'2.2.2' unless defined? RAILS_GEM_VERSION ?

c) rake rails:update <- did that

d) check the routes file for correctness <- they are working normally
(i.e. when deploying directly to the DocumentRoot)

e) run your application locally using mongrel <- works

pedz

unread,
Nov 29, 2008, 11:01:27 AM11/29/08
to Phusion Passenger Discussions
I just came to this group to report this.

The way relative_url_root is processed and set changed. You can look
in the CHANGELOG for Rails 2.2.2.

I'm not sure exactly how to properly fix this but what I did right now
is based from the deprecated message in actionpack-2.2.2/lib/
action_controller/request.rb. It says:

"ActionController::AbstractRequest.relative_url_root= has been
renamed." +
"You can now set it with
config.action_controller.relative_url_root=", caller)

So, in my config/environment.rb file I added:

# Tell Rails we are at a relative offset...
config.action_controller.relative_url_root = "/shikra"

(/shikra is my relative offset)

I *think* that this could be avoided if Passenger set the
RELATIVE_URL_ROOT environment variable but I'm just guessing about
that.

I'd like to hear what others have done / think...

Thomas Marek

unread,
Nov 29, 2008, 11:19:33 AM11/29/08
to phusion-...@googlegroups.com
Hi,

I have the same problem with merb and the RackBaseURI property:
http://groups.google.com/group/phusion-passenger/browse_thread/thread/e81fee9f353ee6a9?hl=en

I *think* that this could be avoided if Passenger set the
RELATIVE_URL_ROOT environment variable but I'm just guessing about
that.

Like i sad in the other thread... me too...


Thomas

WebPain

unread,
Nov 29, 2008, 3:15:27 PM11/29/08
to Phusion Passenger Discussions
Setting config.action_controller.relative_url_root = "/offset" did the
job, thanks!

dmack

unread,
Nov 30, 2008, 3:07:12 PM11/30/08
to Phusion Passenger Discussions
For what it's worth, adding config.action_controller.relative_url_root
also worked for me. Thanks!

Dan
Reply all
Reply to author
Forward
0 new messages