问题
I am running my app on my local server with no issues, and have been pushing to Heroku with no issues until now. I am suddenly seeing this error:
Running: rake assets:precompile
rake aborted!
Sprockets::FileNotFound: couldn't find file 'jquery.ui.all'
My gemfile:
gem 'jquery-rails'
gem 'jquery-ui-rails'
My application.js:
//= require jquery
//= require jquery_ujs
//= require jquery.turbolinks
//= require turbolinks
//= require bootstrap
//= require_tree ./
//= require jquery.ui.all
Let me know if more info is required.
回答1:
Change line in your Gemfile
gem 'jquery-ui-rails', github: 'joliss/jquery-ui-rails', branch: 'rails-4.0.2'
run
bundle update jquery-ui-rails
Now you can put in your application.js
//= require jquery.ui.all
More informations here
回答2:
I had the same problem, and I solved it by renaming the require lines in application.css and application.js.
This issue arises due to changes to the file naming structure in jquery-ui 5.0 (see this discussion).
When using the new versions (>= 5.0.0) of jquery-ui, you need to rename//= require jquery.ui.all to //= require jquery-ui
inapp/assets/javascripts/application.js
and
*= require jquery.ui.all to *= require jquery-ui
inapp/assets/stylesheets/application.css.
Hope this helps!
来源:https://stackoverflow.com/questions/24703754/heroku-rails-4-filenotfound-jquery-ui-all