title: Rails 4 SyntaxError: `$(' is not allowed as a global variable name
body: <p>I'm very new to Rails and feel like I'm missing something. Working with Rails 4.2.10 trying to invoke jQuery commands but keep getting the same error:</p>
  
  <pre><code>irb(main):001:0&gt; $(document).ready()
  Traceback (most recent call last):
          7: from bin/rails:4:in `&lt;main&gt;'
          6: from bin/rails:4:in `require'
          5: from /usr/lib/ruby/vendor_ruby/rails/commands.rb:17:in `&lt;top (required)&gt;'
          4: from /usr/lib/ruby/vendor_ruby/rails/commands/commands_tasks.rb:39:in `run_command!'
          3: from /usr/lib/ruby/vendor_ruby/rails/commands/commands_tasks.rb:68:in `console'
          2: from /usr/lib/ruby/vendor_ruby/rails/commands/console.rb:9:in `start'
          1: from /usr/lib/ruby/vendor_ruby/rails/commands/console.rb:110:in `start'
  SyntaxError ((irb):1: `$(' is not allowed as a global variable name)
  </code></pre>
  
  <p>or inside a controller with the same error...</p>
  
  <pre><code>class PagesController &lt; ApplicationController
  
    def home
      $(document).ready();
      @products = Product.all
    end
  ...
  </code></pre>
  
  <p>I'm using this in my Gemfile, <code>gem 'jquery-rails'</code>, note I ran <code>bundle install</code> already</p>
  
  <p>and, my <code>/app/assets/javascript/application.js</code> looks like this,</p>
  
  <pre><code>//= require jquery
  //= require jquery_ujs
  //= require turbolinks
  //= require bootstrap
  //= require bootstrap-sprockets
  //= require_tree .
  </code></pre>
  
  <p>am I missing something here?</p>