Rails 5: Sprockets::FileNotFound - couldn't find file 'jquery-ui/autocomplete' with type 'application/javascript'
Asked Answered
M

3

8

I just upgraded our Rails app from 4.2.5 to 5.0.1

The rails server boots up fine but when I try to load a page I'm now getting the error:

Sprockets::FileNotFound - couldn't find file 'jquery-ui/autocomplete' with type 'application/javascript'

When I run bundle I can see

Using jquery-rails 4.2.2
Using jquery-ui-rails 6.0.1
Monsour answered 9/1, 2017 at 23:28 Comment(0)
M
2

Seems the file paths have changed. According to the gem readme:

Warning:

Due to directory structure changes between jQuery UI 1.10, 1.11, and 1.12, if you use version is lower than 6.0, you will have to use a different naming for the files to require, please check following links for more information: for 5.0 users, for 4.2 users.

Monsour answered 9/1, 2017 at 23:37 Comment(2)
Changes to: //= require jquery-ui/widgets/autocompleteBilli
Did this answer solve your problem? Seems like you're running > 6.0 so the directory changes in the readme don't seem applicable. I ask because I'm having the same issues and running similar gem versions as you. jquery-rails (4.3.1, 4.2.1, 4.0.5) jquery-ui-rails (6.0.1, 5.0.5)Volumeter
A
6

change the line in application.js

from

//= require jquery-ui/autocomplete

to

 //= require jquery-ui/widgets/autocomplete
Asti answered 4/1, 2018 at 1:46 Comment(1)
This did it for me.Editorialize
M
2

Seems the file paths have changed. According to the gem readme:

Warning:

Due to directory structure changes between jQuery UI 1.10, 1.11, and 1.12, if you use version is lower than 6.0, you will have to use a different naming for the files to require, please check following links for more information: for 5.0 users, for 4.2 users.

Monsour answered 9/1, 2017 at 23:37 Comment(2)
Changes to: //= require jquery-ui/widgets/autocompleteBilli
Did this answer solve your problem? Seems like you're running > 6.0 so the directory changes in the readme don't seem applicable. I ask because I'm having the same issues and running similar gem versions as you. jquery-rails (4.3.1, 4.2.1, 4.0.5) jquery-ui-rails (6.0.1, 5.0.5)Volumeter
S
0

My case was exceptionally weird. When I set up my old legacy app in Ubuntu 20 it worked fine until I rebooted my laptop. After that it displayed the error under question. I checked that I use correct RVM gemset with correct ruby version, gems were bundled as they should have.

When I changed the

//= require jquery-ui/autocomplete

to

//= require jquery-ui/widgets/autocomplete

this line passed and worked fine, but next ones starting causing problems.

Eventually I had to change all the following lines:

//= require jquery-ui/widgets/autocomplete
//= require jquery-ui/widgets/datepicker
//= require jquery-ui/widgets/droppable

EXCEPT THIS: //= require jquery-ui/effect and I have no idea why this single line works while others don't :/

Swampy answered 9/11, 2020 at 19:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.