Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby on Rails: "couldn't find file 'jquery.ui.datepicker'"

Okay, this is driving me nuts. I've been following the instructions to install a JQuery datepicker here: http://railscasts.com/episodes/213-calendars-revised but I'm getting hung up on this error:

Sprockets::FileNotFound in Verifications#new

couldn't find file 'jquery.ui.datepicker'
  (in /app/assets/stylesheets/application.css:11)

Here's application.js:

//= require jquery
//= require jquery.ui.all
//= require jquery_ujs
//= require_tree .

Here's application.css:

 *= require jquery.ui.datepicker
 *= require_self
 *= require_tree .

and in Gemfile:

group :assets do
  gem 'jquery-ui-rails'
end

Anyone see what I'm missing?

like image 485
krstck Avatar asked Oct 04 '13 00:10

krstck


2 Answers

For future readers. First, make sure you've restarted your rails server after installing the gem as krstck answered.

Then, double check the version of your gem. jquery-ui-rails has changed its require syntax in 5.0.0. Now you should write:

//= require jquery-ui/datepicker

Also add to css

*= require jquery-ui/datepicker
like image 95
seancdavis Avatar answered Sep 22 '22 12:09

seancdavis


Answering my own question here in case someone else makes the same dumb mistake. I restarted the rails server, and then it worked.

like image 43
krstck Avatar answered Sep 24 '22 12:09

krstck