How to: Handle javascript_include_tag in production mode

Hi there,

I have the following javascript_include_tags in my application.html.erb
file:

<%= javascript_include_tag ‘jquery/jquery-1.3.2.min’, :cache => ‘jquery’
%>
<%= javascript_include_tag ‘jrails’ %>
<%= javascript_include_tag ‘jquery/jquery.autocomplete.min’, :cache =>
‘jquery’ %>
<%= javascript_include_tag ‘mootools/mootools-1.2.1-core-yc’, :cache =>
‘mootools’ %>
<%= javascript_include_tag ‘mootools/mootools-1.2-more’, :cache =>
‘mootools’ %>
<%= javascript_include_tag ‘mootools/formcheck/formcheck’, :cache =>
‘mootools’ %>

My question:

How come, when I run the production environment on the (virtual
private) server, the javascript files don’t seem to load?
(“XYZ-is-not-a-fuction” errors)

Hints:

  • When I delete the :cache options, the scripts DO load correctly.
  • When I’m in development mode, the whole problem doesn’t occur at all
    (I can have the :cache options).

Thank you for your input!
Tom

Try and give a different name for cache, it could be a name conflict.

<%= javascript_include_tag ‘jquery/jquery-1.3.2.min’, :cache =>
‘myjquery’
%>

<%= javascript_include_tag ‘mootools/mootools-1.2-more’, :cache =>
‘mymootools’ %>

Thanks!

It definitely WAS a name confilct:

I had used cache names (:cache => “XYZ”) several times. They can of
course NOT be identical…