Optinovation
Optinovation

Reputation: 69

Couldn't find file 'jquery', Sprockets::FileNotFound in StaticPages#home error

I am self-studying Michael Hart's guide and am stuck in chapter 7.

When I go to localhost:3000, an error message comes up, saying it couldn't find file jquery and points to line 7 in application.html.erb file.

when I delete the line 7, -> <%= javascript_include_tag "application", "data-turbolinks-track" => true %>, localhost runs normal without an error.

My git repository.

Upvotes: 5

Views: 4527

Answers (4)

marcinowski
marcinowski

Reputation: 359

I solved this by... restarting server! It recollected the libraries and worked like charm.

Upvotes: 0

Paul
Paul

Reputation: 26660

I solved this by reverting to

gem 'jquery-rails', '2.1.4'
gem 'jquery-ui-rails', '4.2.1'

Upvotes: 2

Optinovation
Optinovation

Reputation: 69

I removed Gemfile.lock and ran bundle install once again, and it solved the problem.

Upvotes: 0

Flo
Flo

Reputation: 540

I asume you did'nt run 'bundle install' because:

In application.js you require jquery which should usually come with the the gem 'jquery-rails', '2.2.1'

Upvotes: 0

Related Questions