title: select2-rails gem: installed assets and called function but dropdown not changing (TypeError: undefined is not a function)
body: <p>There are several posts similar to this on SO but I have yet to find one that has an answer checked correct. I am trying to implement the select2-rails gem in my Rails 3.2 app following the instructions at the <a href="https://github.com/argerim/select2-rails" rel="nofollow">GitHub page</a>. I bundled the gem and included the javascript and css files. I then added a js function call like the one in the <a href="http://select-2-example.herokuapp.com/" rel="nofollow">sample code</a>. My select bar, however, isn't changing at all.</p>
  
  <p>Javascript include:</p>
  
  <pre><code># application.js
  //= require jquery
  //= require jquery_ujs
  //= require select2
  //= require jquery-1.11.0.min.js
  //= require lightbox.min.js
  //= require parsley
  //= require ./jquery.datetimepicker.js
  //= require Stripe/jquery.payment.js
  //= require_tree .
  </code></pre>
  
  <p>CSS includes:</p>
  
  <pre><code># application.css.less
  /*
   *= require_tree .
   *= require select2
   *= require select2-bootstrap
   *= stub active_admin
  */
  </code></pre>
  
  <p>My page with the form, just trying to replicate the example:</p>
  
  <pre><code># new.html.haml
  
  =content_for :title, 'Post a job'
  = javascript_include_tag "https://js.balancedpayments.com/1.1/balanced.js"
  :javascript
    var _balanced_marketplace = "#{@balanced_marketplace}";
    var _categories = #{raw(@categories.to_json)};
    $(document).ready(function() { $("#e1").select2(); });
  ...
  ...
  %select{id: "e1"}
    %option{value: "AL"} Alabama
    %option{value: "WY"} Wyoming
  </code></pre>
  
  <p>The end of my script and the HTML generated by the HAML:</p>
  
  <pre><code>$(document).ready(function() { $("#e1").select2(); });
  &lt;/script&gt;
        &lt;select id='e1'&gt;
          &lt;option value='AL'&gt;Alabama&lt;/option&gt;
          &lt;option value='WY'&gt;Wyoming&lt;/option&gt;
        &lt;/select&gt;
  </code></pre>
  
  <p>All of this just results in a normal select drop-down with no select2 styling/features. </p>
  
  <p>In the Javascript console I am seeing the following error for my function call: </p>
  
  <pre><code>Uncaught TypeError: undefined is not a function 
  </code></pre>
  
  <p>I am not extremely familiar with Javascript but I'm guessing this means that there is a problem with the function `select2()'. However, I am not sure how to begin debugging this since I've followed the gem installation instructions word-for-word. When I view the page source I see the select2 js library being loaded as follows:</p>
  
  <pre><code>&lt;script src="/assets/select2.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>