Forum: Rails deployment Asset Pipeline Problem

677893e03828c7d3f0f3a571639f2bbb?d=identicon&s=25 Neil Chaudhuri (vidyallc)
on 2011-12-26 19:40
I am developing a new application with Ruby 1.9.2 and Rails 3.1. When I
deploy the application in development mode, I find all my assets
(images, CSS files, and JS files) listed individually in the HTML:

[code]
<link href="/assets/reset.css?body=1" media="screen" rel="stylesheet"
type="text/css" />
<link href="/assets/application.css?body=1" media="screen"
rel="stylesheet" type="text/css" />
<link href="/assets/forms.css?body=1" media="screen" rel="stylesheet"
type="text/css" />
<script src="/assets/jquery.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery_ujs.js?body=1"
type="text/javascript"></script>
<script src="/assets/global.js?body=1" type="text/javascript"></script>
<script src="/assets/application.js?body=1"
type="text/javascript"></script>
[/code]

Note that the application.* files above are empty in content, but it
doesn't matter because all the component CSS and JS files are listed
individually. So the page looks as it should. This is development mode,
so I don't really care that so many HTTP fetches are necessary.

When I deploy in production mode, I find this:

[code]
<link href="/stylesheets/application.css" media="screen"
rel="stylesheet" type="text/css" />
<script src="/javascripts/application.js"
type="text/javascript"></script>
[/code]

These application.* files are still empty because the contents of the
component files are not copied into them, and with the component CSS and
JS files not included individually, my page has no style or
functionality. Also, the lone image on the page isn't displayed.

I have set [i]config.serve_static_assets = true[/i] in production.rb. In
fact, just for fun, I completely copied the contents of development.rb
into production.rb, but the result is the same.

Any insight into what I can do to solve the problem is appreciated.

Thanks and Happy Holidays.
This topic is locked and can not be replied to.