最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

[Ruby on Rails]couldn't find file 'jquery-uiautocomplete' with type 'applicationjavascript&#

programmeradmin0浏览0评论

I want to use rails-jquery-autoplete gem for my rails application. However I got this error:

couldn't find file 'jquery-ui/autoplete' with type 'application/javascript'

My jquery-rails version is 4.3.1 and jquery-ui-rails version is 6.0.1.

application.js

//= require jquery
//= require jquery_ujs
//= require jquery-ui/autoplete
//= require autoplete-rails
//= require bootstrap-sprockets
//= require moment
//= require bootstrap-datetimepicker
//= require jquery.payment 
//= require credit_card                                                                                                             
//= require map
//= require owl.carousel.min
//= require carousel
//= require react
//= require react_ujs
//= require ponents

application.scss

*= require_self                                                                                                                    
*= require jquery-ui

Thank you in advance!

I want to use rails-jquery-autoplete gem for my rails application. However I got this error:

couldn't find file 'jquery-ui/autoplete' with type 'application/javascript'

My jquery-rails version is 4.3.1 and jquery-ui-rails version is 6.0.1.

application.js

//= require jquery
//= require jquery_ujs
//= require jquery-ui/autoplete
//= require autoplete-rails
//= require bootstrap-sprockets
//= require moment
//= require bootstrap-datetimepicker
//= require jquery.payment 
//= require credit_card                                                                                                             
//= require map
//= require owl.carousel.min
//= require carousel
//= require react
//= require react_ujs
//= require ponents

application.scss

*= require_self                                                                                                                    
*= require jquery-ui

Thank you in advance!

Share Improve this question edited Aug 7, 2017 at 11:24 Graham Slick 6,87011 gold badges56 silver badges92 bronze badges asked Aug 7, 2017 at 10:56 JiaPingJiaPing 1192 silver badges14 bronze badges 5
  • It should be //= require jquery-ui/widgets/autoplete github./jquery-ui-rails/jquery-ui-rails – Pardeep Dhingra Commented Aug 7, 2017 at 11:03
  • 1 I added this line in my application.js file. However, it can't solve my problem. – JiaPing Commented Aug 7, 2017 at 11:13
  • What error you are getting after adding this? – Pardeep Dhingra Commented Aug 7, 2017 at 11:18
  • 1 I got the the same error message. – JiaPing Commented Aug 7, 2017 at 11:23
  • having the same problem here...were you able to solve? – Tamiz Ahmed Commented Aug 23, 2017 at 7:25
Add a ment  | 

3 Answers 3

Reset to default 10

If You have install jquery-ui-rails gem. Remove rails-jquery-autoplete gem from your project.Just add this line:

 //= require jquery-ui/widgets/autoplete

Restart your server after adding a gem or a library.

I made a temporary fix. My error message plained about jquery-ui/widgets/autoplete.

In my system, the autoplete.js file is at ...gems/jquery-ui-rails-5.0.5/app/assets/javascripts/jquery-ui. When in that directory, I said

mkdir widgets
cd widgets
ln -s ../autoplete.js autoplete.js 

I could not test if autoplete actually works now, but at least the error message went away.

发布评论

评论列表(0)

  1. 暂无评论