Reputation: 11
I'm a newbie and have seen this error a lot on here, but no solution seems to work for me.
It gives me the error Sprockets::FileNotFound in Pages#home couldn't find file 'jquery' in line 6 of application.html.erb <%= javascript_include_tag 'application' , 'data-turbolinks-track' => true %>
Things I've already tried:
Nothing I do seems to work.
This is my application.js file
//= require jquery
//= require jquery.turbolinks
//= require jquery-ui
//= require jquery_ujs
//= require bootstrap
//= require turbolinks
//= require_tree .
This is my application.html.erb
<!DOCTYPE html>
<html>
<head>
<title>My Application</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application' , 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
<body>
<%= render 'layouts/header' %>
<%= yield %>
<%= render 'layouts/footer' %>
</body>
</html>
Gemfile:
source 'https://rubygems.org'
gem 'rails', '4.1.4'
gem 'bootstrap-sass', '~> 3.2.0'
gem 'sass-rails', '~> 4.0.3'
gem "jquery-rails"
gem 'jquery-ui-rails'
group :production do
gem 'pg'
end
group :development, :test do |variable|
gem 'sqlite3'
end
group :assets do
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'turbolinks'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'spring', group: :development
end
Thanks!
Upvotes: 1
Views: 1460
Reputation:
Try this one in your application.html.erb
<%= javascript_include_tag "application" %>
I don't see anything wrong in your Gemfile. And one thing always restart your server after running a bundle install
.
Upvotes: 0