title: Turbolinks causing a "jquery-ujs has already been loaded!" error
body: <p>I have a newish Rails 4 app which contains <em>no</em> custom Javascript - the folders <code>app/assets/javascripts</code>, <code>lib/assets/javascripts</code> and <code>vendor/assets/javascripts</code> are all empty (apart from <code>app/assets/javascripts/application.js</code>).</p>
  
  <p>When I click around the app I keep getting the error <code>jquery-ujs has already been loaded!</code> in the JS console. It happens every time I hit the "back" button, and sometimes when I click a normal link (although I can't make it happen consistently.)</p>
  
  <p><strong>application.js:</strong></p>
  
  <pre><code>//= require jquery
  //= require jquery_ujs
  //= require twitter/bootstrap
  //= require turbolinks
  //= require_tree .
  </code></pre>
  
  <p>When I remove turbolinks from application.js, I stop getting the error... so turbolinks appears to be the culprit.</p>
  
  <p>Is this a bug with turbolinks, or am I doing something wrong?</p>
  
  <p>Here's my Gemfile:</p>
  
  <pre><code>source 'https://rubygems.org'
  
  ruby '2.0.0'
  
  gem 'rails', '4.0.0'
  
  gem 'active_model_serializers'
  gem 'aws-sdk'
  gem 'bootstrap-sass-rails'
  gem 'coffee-script-source', '1.5.0'
  gem 'coffee-rails', '~&gt; 4.0.0'
  gem 'devise'
  gem 'factory_girl_rails', '4.1.0'
  gem 'figaro'
  gem 'font-awesome-sass-rails'
  gem 'jbuilder', '~&gt; 1.2'
  gem 'jquery-rails'
  gem 'paperclip'
  gem 'paperclip-meta', github: 'y8/paperclip-meta'
  gem 'pg'
  gem 'sass-rails', '~&gt; 4.0.0'
  gem 'turbolinks'
  gem 'uglifier', '&gt;= 1.3.0'
  
  group :production do
    gem 'rails_12factor'
  end
  
  group :doc do
    gem 'sdoc', require: false
  end
  
  group :test do
    gem 'capybara', '2.1.0'
  end
  
  group :development, :test do
    gem 'childprocess', '0.3.9'
    gem 'debugger'
    gem 'faker', '~&gt; 1.2.0'
    gem 'json_spec'
    gem 'rspec-rails'
    gem 'rspec-mocks'
  end
  
  group :development do
    gem 'annotate'
    gem 'hirb'
    gem 'wirb'
  end
  </code></pre>
  
  <p>Changing around the order of the <code>require</code>s in application.js doesn't seem to help either.</p>