When I run rake assets: precompile got could not find the jquery file in application.js on // = require jquery

when i run

bundle exec rake assets:precompile 

I got

couldn't find file 'jquery'  

in application.js in a line:

//= require jquery

Rails 3.2.2. What reason?

+3
source share
2 answers

I would venture to say that you do not have a jquery.js file anywhere in your application. If it is not in the application / assets or suppliers / assets or lib / assets, add them to one of them - or if you are using the jquery-rails pearl, follow the instructions.

+4
source

If you work in production, you should comment on the line.

Bundler.require(*Rails.groups(:assets => %w(development test)))

and uncomment the following

Bundler.require(:default, :assets, Rails.env)

, "", Gemfile, .

, , Uglifier " jquery", .

+4

All Articles