Heroku Rails 4— FileNotFound jquery.ui.all

泄露秘密 提交于 2020-01-14 06:10:15

问题


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
in
app/assets/javascripts/application.js

and

*= require jquery.ui.all to *= require jquery-ui
in
app/assets/stylesheets/application.css.

Hope this helps!



来源:https://stackoverflow.com/questions/24703754/heroku-rails-4-filenotfound-jquery-ui-all

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!