# How to: Handle javascript\_include\_tag in production mode

**URL:** <https://www.ruby-forum.com/t/how-to-handle-javascript-include-tag-in-production-mode/173763>\
**Category:** Rails\
**Created:** [August 14, 2009, 11:04am UTC](https://www.ruby-forum.com/t/how-to-handle-javascript-include-tag-in-production-mode/173763 "2009-08-14T11:04:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [August 14, 2009, 11:04am UTC](https://www.ruby-forum.com/t/how-to-handle-javascript-include-tag-in-production-mode/173763/1 "2009-08-14T11:04:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [August 14, 2009, 12:33pm UTC](https://www.ruby-forum.com/t/how-to-handle-javascript-include-tag-in-production-mode/173763/2 "2009-08-14T12:33:28Z")

</div>

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’ %\>

---

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [August 14, 2009, 1:37pm UTC](https://www.ruby-forum.com/t/how-to-handle-javascript-include-tag-in-production-mode/173763/3 "2009-08-14T13:37:01Z")

</div>

Thanks!

It definitely WAS a name confilct:

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