couldn't find file 'turbolinks' in Rails 4.0.4 app

at. picture at. · Mar 15, 2014 · Viewed 10.1k times · Source

I just upgraded from Rails 3.2.17 to 4.0.4 and everything looks great. I copied over a lot of the config files from a brand new test 4.0.4 app I created. However, when I add in the following line to my app/assets/javascripts/application.js file, I get an error:

//= require turbolinks

The error is:

couldn't find file 'turbolinks'
  (in /Users/scott/Code/ucode/app/assets/javascripts/application.js:15)

I want turbolinks. I'm on Rails 4.0.4. My test app didn't have this error. Why am I getting this error and how do I fix it? I also updated my app/views/layouts/application.html.erb file to include:

<%= javascript_include_tag "application", "data-turbolinks-track" => true %>

Answer

Joe Kennedy picture Joe Kennedy · Mar 15, 2014

Have you added the turbolinks gem to your Gemfile?

gem 'turbolinks'