# Asset-caching

**URL:** <https://www.ruby-forum.com/t/asset-caching/123609>\
**Category:** Rails\
**Created:** [December 19, 2007, 4:22am UTC](https://www.ruby-forum.com/t/asset-caching/123609 "2007-12-19T04:22:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luisS\_syndeomedia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/85e7bf/32.png) [@luisS\_syndeomedia](https://www.ruby-forum.com/u/luisS_syndeomedia)\
**Post date:** [December 19, 2007, 4:22am UTC](https://www.ruby-forum.com/t/asset-caching/123609/1 "2007-12-19T04:22:32Z")

</div>

Having solved my previous asset\_hosts problem, I’m now moving on to  
bigger and more entertaining issues, this one involving  
javascript\_include\_tag’s new :cache parameter.

Code snippet thus:

\<%= javascript\_include\_tag “prototype”, “scriptaculous”,  
“effects”, :cache =\> “base” %\>

Run it on production and guess what error I get:

A ActionView::TemplateError occurred in users#show:  
Permission denied - /var/www/apps/moomai/releases/20071219025219/  
public/javascripts/base.js  
On line #8 of users/show.rhtml

The Rails user doesn’t have access to the caches it generates? Nice.  
Any ideas?

---

<div class="post-metadata">

**Author:** ![luisS\_syndeomedia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/85e7bf/32.png) [@luisS\_syndeomedia](https://www.ruby-forum.com/u/luisS_syndeomedia)\
**Post date:** [December 19, 2007, 4:37am UTC](https://www.ruby-forum.com/t/asset-caching/123609/2 "2007-12-19T04:37:50Z")

</div>

Are you sure the file exists and if not, it can be created?

Sounds more like the process running your app (‘mongrel’? ‘nobody’?)  
doesn’t have permission to WRITE (create) the file to begin with.

Just a thought.

---

<div class="post-metadata">

**Author:** ![luisS\_syndeomedia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/85e7bf/32.png) [@luisS\_syndeomedia](https://www.ruby-forum.com/u/luisS_syndeomedia)\
**Post date:** [December 19, 2007, 9:34am UTC](https://www.ruby-forum.com/t/asset-caching/123609/3 "2007-12-19T09:34:50Z")

</div>

Yeah you’re right … the files don’t exist at all, so Rails clearly  
couldnt write to that directory. Not sure exactly what I’m supposed to  
do in this instance though. The particular user is mongrel\_moomai, and  
the /releases folder has drwxrwxr-x permissions for deploy:deploy, of  
which mongrel\_moomai is a member.

I tried doing a `chmod ug+rw public/javascripts && chmod ug+rw public/ stylesheets` but that didn’t really work.  
The main issue is that I don’t know what’s writing the file and how to  
give it write access to those particular folders.

:luis
