Could not find file 'jquery-ui'

I get the following error even if I have jquery-ui in application.js file

could not find the file 'jquery-ui' (in / home / jeff / work / projects / a / media / app / assets / javascripts / application.js: 14)

application.js

//= require jquery //= require jquery_ujs //= require jquery-ui //= require jquery.validate.min 

Can someone help me?

+58
javascript jquery ruby-on-rails
Jul 24 '13 at 9:38
source share
6 answers

Use the special gem "jquery-rails", "~> 2.3.0" version of gem "jquery-rails", "~> 2.3.0" , since a later version of gem has removed the ui part.

or

you can use the gem "jquery-ui-rails" for jquery-ui . For more information visit the git repository

To require all jQuery user interface modules, add the following to your application.js:

for version 5.0 and more, it has been changed. Please follow the link

application.js:

 //= require jquery-ui 

application.css:

 /* *= require jquery-ui */ 

For a smaller version than 5.0, we need to write the format below

application.js:

 //= require jquery.ui.all 

Also add jQuery UI CSS to your application.css:

application.css:

 /* *= require jquery.ui.all */ 

Hope this helps you.

+114
Jul 24 '13 at 10:01
source share

I think you are using the new version (your version> 2.3.0) of jquery-rails.

jQuery UI has been removed from jquery-rails gem,

  • ≤ jquery-rails v2.3.0 is still a jQuery user interface
  • ≥ jquery-rails v3.0.0 Remote User Interface

Check out this commit .

If you are using ≥ jquery-rails v3.0.0 or the latest version of jquery-rails

You should use jquery-ui-rails gem to use jquery UI in rails, https://github.com/joliss/jquery-ui-rails .

In your gemfile add:

gem 'jquery-ui-rails'

and run bundle install

  • v2.3.0 <your version ≤ v4.2.1

    And put this in application.js

     //= require jquery.ui.all 

    then put this in application.css

     *= require jquery.ui.all 
  • ≥ jquery-ui-rails v5.0.0 or latest version

    And put this in application.js

     //= require jquery-ui 

    then put this in application.css

     *= require jquery-ui 

    or use specific modules read this

Do not forget to restart the server.

If you are using ≤ jquery-rails v2.3.0

see my answer here https://stackoverflow.com gem 'jquery-rails', "~> 2.3.0"

+34
Jul 24 '13 at 9:58 on
source share

Answers to rails 4:

add to gemfile.rb:

 gem 'jquery-ui-rails' 

add to application.js:

 //= require jquery //= require jquery-ui //= require jquery_ujs 

To add a specific module:

 //= require jquery //= require jquery-ui/yourmodulename //= require jquery_ujs 

I'm not sure that restarting the server is clearly required, but it never hurts anything.

+9
Jul 09 '14 at 2:15
source share

I know this is a noob bug, but I found it very disappointing and always forget to restart the application after I installed something new.

Be sure to restart the rail server after you have completed the instructions above and should work fine.

+4
Oct 27 '14 at 3:46
source share

Kind of noob error, but if that helps someone ..

I added jQuery-ui.js to my assets and then added a gem. Then js was removed from the assets, but my IDE also deleted the same files from the gem.

To solve the problem, first remove the gem and then run it,

 bundle clean --force 

and then

 bundle install 
+1
Sep 08 '14 at 18:32
source share

It could just be restarting WEBrick or any other server that you can use to collect new assets. For WEBrick, just go to the terminal window where your server is running and CTRL-C to complete the process, then simply restart it again using rails s or whatever command runs to start your server.

0
Apr 18 '15 at 22:14
source share



All Articles