title: Javascript error in rails app when integrating Stripe API
body: <p>I am using the Koudoku gem to integrate Stripe into my rails app, and when I load the page that captures the users credit card information, the Stripe javascript should run, however, my JS console shows the following error:</p>
  
  <pre><code>Uncaught ReferenceError: $ is not defined
  (anonymous function)
  </code></pre>
  
  <p>This is the JS provided by Koudoku/Stripe that should run when the page loads:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
    // All this code taken from Stripe's own examples at:
    // https://stripe.com/docs/tutorials/forms .
  
    function stripeResponseHandler(status, response) {
  
        if (response.error) {
            // show the errors on the form
            $(".payment-errors").text(response.error.message).show();
            $(".submit-button").removeAttr("disabled");
        } else {
            var form$ = $("#payment-form");
            // token contains id, last4, and card type
            // insert the token into the form so it gets submitted to the server
            form$.append("&lt;input type='hidden' name='subscription[credit_card_token]' value='" + response['id'] + "'/&gt;");
            form$.append("&lt;input type='hidden' name='subscription[last_four]' value='" + response['last4'] + "'/&gt;");
            form$.append("&lt;input type='hidden' name='subscription[card_type]' value='" + response['card_type'] + "'/&gt;");
            // and submit
            form$.get(0).submit();
        }
    }
  
    $(document).ready(function() {
  
      console.log("testing log")
  
      Stripe.setPublishableKey("&lt;%= Koudoku.stripe_publishable_key %&gt;");
  
      // By default, don't show errors.
      $(".payment-errors").hide()
  
      $("#payment-form").submit(function(event) {
  
        // disable the submit button to prevent repeated clicks
        $('.submit-button').attr("disabled", "disabled");
  
        Stripe.createToken({
            number: $('.card-number').val(),
            cvc: $('.card-cvc').val(),
            exp_month: $('.card-expiry-month').val(),
            exp_year: $('.card-expiry-year').val()
        }, stripeResponseHandler);
  
        // prevent the form from submitting with the default action
        return false;
      });
    });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Needless to say, the <code>console.log("testing log")</code> is not being logged.</p>
  
  <p>I am using coffeescript in other parts of my app, and I am using jQuery elsewhere as well. Here is my Gemfile:</p>
  
  <pre><code>source 'https://rubygems.org'
  ruby '2.0.0'
  #ruby-gemset=railstutorial_rails_4_0
  
  gem 'rails', '4.0.0'
  gem 'bcrypt-ruby', '3.0.1'
  gem 'faker', '1.1.2'
  gem 'will_paginate', '3.0.4'
  
  gem 'foundation-rails'
  # gem 'chosen-rails'
  gem 'select2-rails'
  
  gem 'pg'
  
  gem 'devise'
  gem 'cancan'
  
  gem 'state_machine'
  
  gem 'koudoku'
  
  group :development, :test do
    gem 'rspec-rails'
    # The following optional lines are part of the advanced setup.
    gem 'guard-rspec'
    gem 'spork-rails', github: 'sporkrb/spork-rails'
    gem 'guard-spork'
    gem 'childprocess', '0.3.6'
  end
  
  group :development do
    gem 'better_errors'
    gem 'binding_of_caller'
    gem 'meta_request'
    gem 'debugger'
  end
  
  group :test do
    gem 'selenium-webdriver'
    gem 'capybara'
    gem 'factory_girl_rails'
    # gem 'cucumber-rails', '1.3.0', :require =&gt; false
    gem 'database_cleaner', github: 'bmabey/database_cleaner'
  
    # gem 'simplecov', :require =&gt; false
  
    # Uncomment this line on OS X.
    gem 'growl', '1.0.3'
  
    # Uncomment these lines on Linux.
    # gem 'libnotify', '0.8.0'
  
    # Uncomment these lines on Windows.
    # gem 'rb-notifu', '0.0.4'
    # gem 'win32console', '1.3.2'
  end
  
  gem 'sass-rails', '4.0.0'
  gem 'uglifier', '2.1.1'
  gem 'coffee-rails', '4.0.0'
  gem 'jquery-rails', '2.2.1'
  # gem 'turbolinks', '1.1.1'
  gem 'jbuilder', '1.0.2'
  
  group :doc do
    gem 'sdoc', '0.3.20', require: false
  end
  
  group :production do
    gem 'rails_12factor', '0.0.2'
  end
  </code></pre>
  
  <p>Any idea what is causing this issue and/or how to fix it? Thanks!</p>