Cannot find "jquery-ui" Rails 3.2

I searched everywhere to understand this problem. I already downgraded gem jquery-rails to 2.3.0 in my gemfile. But when I include jquery-ui in application.js, I still get the Sprokets :: FileNotFound error.

couldn't find file 'jquery-ui' (in /home/richard/projects/pickaxe/mini-projects/depot-app/app/assets/javascripts/application.js:14) 

This is my application.js file:

 // This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. // // It not advisable to add code directly here, but if you do, it'll appear at the bottom of the // the compiled file. // // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT TO BE PROCESSED, ANY BLANK LINE SHOULD // GO AFTER THE REQUIRES BELOW. // //= require jquery //= require jquery-ui //= require jquery_ujs //= require_tree . 

I am dying to find out why this does not work ...

+3
jquery ruby jquery-ui ruby-on-rails gemfile
Jun 08 '13 at 5:56 on
source share
3 answers

If you are using jquery-ui-rails gem , you need to use require jquery.ui.all instead of require jquery-ui . If you do not want to use the gem, make sure you have the jquery-ui.js in your app/assets/javascripts folder.

UPDATE

Starting with version 5.0.0 use require jquery.ui .

+8
Jun 08 '13 at 6:05
source share

I tried changing jquery-rails on my application, this works great.

  • Put the gem 'jquery-rails', "~> 2.3.0" in the Gemfile
  • Delete Gemfile.lock → rm Gemfile.lock
  • Run bundle install
  • Put //= require jquery-ui in application.js
 Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-06-08 13:16:50 +0700 Compiled jquery-ui.js (27ms) (pid 7016) Compiled application.js (148ms) (pid 7016) Served asset /application.js - 200 OK (213ms) 

Could you post your gemfile?

+3
Jun 08 '13 at 6:20
source share

I had a similar problem. The problem was not related to existing gems, but rather to their cached version.

The following steps solved the problem for me:

  • Indicate the actual versions for the affected stones.
  • Clean the asset pipeline by running rake assets:clean
  • Clear browser cache
  • Start the server again

This process will not be the same for everyone, since the problem here is with the cached version of the gems, as I said.

At least this should help find a solution.

0
Jul 05 '14 at 13:23
source share



All Articles