Tam
Tam

Reputation: 12042

Exception with javascript_include_tag with Phusion Passenger in Rails

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

Upvotes: 0

Views: 719

Answers (1)

Ben Crouse
Ben Crouse

Reputation: 8348

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

Upvotes: 1

Related Questions