views:

218

answers:

1

Hi,

In my Rails app. the javascript_include_tag seems to work fine in my localhost (mogrel) but I move to production(Phusion Passenger) it seems to behave differently and I get the following exception: (not sure what it's asking for all.js!!)

A ActionView::TemplateError occurred in posts#show:

  Permission denied - /var/www/war/releases/20091021160940/public/javascripts/all.js
  On line #9 of app/views/layouts/base_posts.html.erb

    6:     <%= stylesheet_link_tag 'prototube/prototube', :media => 'all' %>
    7:     <%= stylesheet_link_tag 'flowplayer', :media => 'all' %>   
    8:
    9:    <%= javascript_include_tag :defaults, 'jquery','jquery.tools.min', 'thickbox', 'truncator', :cache=>true %>           
    10:     <script type="text/javascript" src="/javascripts/prototube.js"></script>       
    11:     <script type="text/javascript" src="/javascripts/swfobject.js"></script>   
    12:     <script type="text/javascript" src="/javascripts/scriptaculous.js?load=effects"></script>

any ideas?

Thanks,

Tam

+1  A: 

Check the permissions on that directory on your server. When :cache => true, Rails will create a combined javascript file to serve (to save client HTTP requests).

See http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#M001713

Ben
Thanks. That seems to do the trick (I tried chmod -R 777 on the javascripts folder). You know what is the minimum that I can do with? as 777 is not secure?
Tam