Getting error: couldn't find file 'jquery.ui.datepicker' #3257

vhodges opened this Issue Jul 5, 2014 · 13 comments


None yet

vhodges commented Jul 5, 2014

Fresh rails 4.1.1 app, added Active Admin gem, followed the setup steps, when I browse to http://localhost:3000/admin/ I get the above error when trying to render the admin login page.

I've tried adding the jquery-ui-rails gem to my Gemfile, bundling and restarting, but it doesn't help. There are a bunch of related questions on Stack Overflow, but they don't seem to help (and are quite old).

manfrin commented Jul 5, 2014

+1, I have tried specifically adding the jquery-ui-rails gem, and downgrading jquery-rails to 2.3.0 as stackoverflow answers have suggested, neither works.

I'm getting the same problem here

jquery-ui-rails 5.0.0 has renamed the .js files that AA uses. As a workaround, until AA is updated, put the 4.2.1 version in your gemfile and re-run bundle:

gem 'jquery-ui-rails', '~> 4.2.1'

@mfairburn nvm I forgot to restart the rails server, after restarting the server AA starts loading

vhodges commented Jul 6, 2014

Thanks, @mfairburn that works for now.

Looks like this has been fixed. If you require 4 now, it will break as active_admin is referencing the new paths. You can remove jquery-ui-rails from your Gemfile completely.

See: 7b9ad75


seanlinsley commented Jul 28, 2014

Sorry, yes, this has been resolved. This ticket fell through the cracks since it wasn't referenced by the other tickets.

jbae995 commented Jan 18, 2017

Hey guys, im real new to rails and i'm having this problem in 2017. Really don't know where im going wrong.

couldn't find file 'jquery-ui/datepicker' with type 'application/javascript' Checked in these paths: /Users/jsbae/Desktop/unisports/app/assets/config /Users/jsbae/Desktop/unisports/app/assets/images /Users/jsbae/Desktop/unisports/app/assets/javascripts /Users/jsbae/Desktop/unisports/app/assets/stylesheets /Users/jsbae/Desktop/unisports/vendor/assets/javascripts /Users/jsbae/Desktop/unisports/vendor/assets/stylesheets

This is what is happening when I try to run the rails server. I have checked my gemlist and can see i have:

jquery-rails (4.2.2, 4.2.1) jquery-turbolinks (2.1.0) jquery-ui-rails (6.0.1, 5.0.5) jqueryui_rails (0.0.4)

I have seen a lot of posts on problems with the versions, so i also tried to downgrade jquery-rails and jquery-ui-rails, but when running the commands such as: gem install 'jquery-rails','>2.3.0' OR gem install 'jquery-ui-rails', '> 4.2.1'

but they constantly send me errors like----- ERROR: Could not find a valid gem 'jquery-rails-2.3.0' (>= 0) in any repository ERROR: Possible alternatives: jquery_rails3, jquery-rails, jquery-rails-cdn, jquery-rails_vho, jquery-rails-aristo

I have also tried editing the application.js and application.css files with '*= require jquery-ui' & '//= require jquery-ui'

Please help, i just want to run an app....

OscarBarrett commented Jan 18, 2017

If you're using jquery-ui-rails 4.x, require jquery.ui and jquery.ui.datepicker, not jquery-ui

@jbae995 I was running into the same issues. What finally worked for me was adding to my gem file:

gem 'jquery-ui-rails', '5.0.0'

then running bundle update

And in my application.js file I added:

//= require jquery-ui
//= require jquery-ui/datepicker-ru

And lastly, in my application.css.scss file I added:

*= require jquery-ui

Then make sure to restart your rails server. I hope this helps!!

spajus commented Feb 12, 2017

For jquery-ui-rails 6+

//= require jquery-ui/widgets/datepicker

//= require jquery-ui/widgets/datepicker

Inside application.js ?

@JeansReal Yep, inside the application.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment