Error with adding JQuery
<p>I added JQuery to my HTML file:</p>

<pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"&gt;&lt;/script&gt; 
</code></pre>

<p>Then I add a link to my JavaScript file:</p>

<pre><code>&lt;script src="public/javascripts/new_javascript.js" type="text/javascript"&gt;&lt;/script&gt; 
</code></pre>

<p>(I checked that this link work.)</p>

<p>In the file I do</p>

<pre><code>$(document).ready(function() {
   alert("hey!");
});
</code></pre>

<p>But the Google Chrome developer tool shows an error:</p>

<pre><code>Uncaught TypeError: Object #&lt;HTMLDocument&gt; has no method 'ready'
</code></pre>

<p>How can it be an error?</p>

<p>I'm doing this in Rails, and the HTML is like:</p>

<pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"&gt;&lt;/script&gt;   
&lt;script src="public/javascripts/prototype.js?1349898477" type="text/javascript"&gt;&lt;/script&gt; 
&lt;script src="public/javascripts/effects.js?1349898477" type="text/javascript"&gt;&lt;/script&gt; 
&lt;script src="public/javascripts/dragdrop.js?1349898477" type="text/javascript"&gt;&lt;/script&gt; 
&lt;script src="public/javascripts/controls.js?1349898477" type="text/javascript"&gt;&lt;/script&gt; 
&lt;script src="public/javascripts/rails.js?1349898477" type="text/javascript"&gt;&lt;/script&gt; 
&lt;script src="public/javascripts/application.js?1349898477" type="text/javascript"&gt;&lt;/script&gt; 
&lt;script src="public/javascripts/new_javascript.js?1351137775" type="text/javascript"&gt;&lt;/script&gt; 
</code></pre>
