views:

308

answers:

5

before the moans and groans, my client is using Godaddy to host his rails app. I have managed to get the app working for him, but Godaddy uses a sym link to point to the app which appends the root of the website ex.

www.yoursite.com/myrailsapp

I have tried putting this in the environment.rb

Basically all the links is suppose to work like this:

www.yoursite.com/link1

but instead it becomes:

www.yoursite.com/myrailsapp/link1

Is there any way to get the RAILS_ROOT to point at the actual rails root app directory?

A: 

RAILS_ROOT is simply defined in boot.rb. Although it's not expected you should have to change it, nothing is stopping you. It's typically near the very start of the file, right after the "don't change this" plea, and looks something like:

RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
tadman
A: 

would this work:

RAILS_ROOT = "/home/#{File.dirname(FILE)}/.." unless defined?(RAILS_ROOT)

+2  A: 

I don't believe this is a RAILS_ROOT issue, but more of a VirtualHost issue. The domain isn't setting the DocumentRoot to your Rails public directory.

Garrett
You could look at routing your requests of /* to public/* or whatnot with .htaccess.
Garrett
+1  A: 

As Garrett mentioned this is definitely a VirtualHost issue. RAILS_ROOT is a directory pointer to the location of the application in the file system on the server not the location in the URL.

There are several options to get around this depending on what the application is deployed under (Passenger, FastCGI, mongrel, etc.). What you want to look for is how to setup you app to function in the subdirectory of your domain.

Peer Allan
A: 

The host ( goDaddy =[ ) is running FCGI. Any suggestions on a work around? I've been playing around with the routing as well, but no luck. Thanks for the suggestions tho