# Rails fails to find the CSS

**URL:** <https://www.ruby-forum.com/t/rails-fails-to-find-the-css/173279>\
**Category:** Rails\
**Created:** [August 6, 2009, 6:33am UTC](https://www.ruby-forum.com/t/rails-fails-to-find-the-css/173279 "2009-08-06T06:33:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ritvvij](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bbce88/32.png) [@Ritvvij](https://www.ruby-forum.com/u/Ritvvij)\
**Post date:** [August 6, 2009, 6:33am UTC](https://www.ruby-forum.com/t/rails-fails-to-find-the-css/173279/1 "2009-08-06T06:33:43Z")

</div>

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

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

Someone please advise

---

<div class="post-metadata">

**Author:** ![Ritvvij](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bbce88/32.png) [@Ritvvij](https://www.ruby-forum.com/u/Ritvvij)\
**Post date:** [August 6, 2009, 6:40am UTC](https://www.ruby-forum.com/t/rails-fails-to-find-the-css/173279/2 "2009-08-06T06:40:09Z")

</div>

On commenting config.action\_controller.relative\_url\_root = “/  
rails\_apps”  
It started working  
ignore! … 🙂

---

<div class="post-metadata">

**Author:** ![Ritvvij](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bbce88/32.png) [@Ritvvij](https://www.ruby-forum.com/u/Ritvvij)\
**Post date:** [August 6, 2009, 7:39pm UTC](https://www.ruby-forum.com/t/rails-fails-to-find-the-css/173279/3 "2009-08-06T19:39:19Z")

</div>

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 J.
