Rails fails to find the CSS

Hi,

I hosted my site in production mode on a web hosting service. The folder structure is /home/my_username/rails_apps/proj/

I did the normal referencing <%= stylesheet_link_tag "menus" %> in layouts/application.html.erb

But when I load the website, I dont see css effects. So I did page view source and see that the href is point to /rails_apps/stylesheets instead of the usual rails_apps/proj/public/stylesheets

Not sure why is this happening. BTW i have a line in the environment.rb which is needed config.action_controller.relative_url_root = "/rails_apps" It might be due to this.

Then I tried the manual way, instead of using <%= stylesheet_link_tag "menus" %> in the code I used         <link href="/home/username/rails_apps/myproj/public/ stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />

Still getting error in logs ActionController::RoutingError (No route matches "/stylesheets/ tabs.css" with {:method=>:get}):

Someone please advise

On commenting config.action_controller.relative_url_root = "/ rails_apps" It started working ignore! ... :slight_smile:

Note that you seem to have a little confusion about the filesystem vs. application path issue - the "manual way" would use a path of "/ stylesheets/application.css", as the app's web-visible root is public/ inside your Rails app.

--Matt Jones