Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ruby on rails ails with couldn't find file 'jquery.ui.all'

couldn't find file 'jquery.ui.all' which is a known issue, I added *=require jquery.ui.all to application.css and //= require jquery.ui.all to application.js but still get the error. http://bpaste.net/show/1RqTDUte2XLBoj8fdTbf/

Sprockets::FileNotFound in Preorder#index

Showing /var/www/localhost/htdocs/selfstarter/app/views/layouts/application.html.erb where line #6 raised:

couldn't find file 'jquery.ui.all' (in /var/www/localhost/htdocs/selfstarter/app/assets/stylesheets/application.css:14)

Extracted source (around line #6):

3:   <head>
4:     <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
5:     <title><%= Settings.product_name %></title>
6:     <%= stylesheet_link_tag    "application" %>
7:     <%= javascript_include_tag "application" %>
8:   </head>
9:   <!--[if lt IE 9 ]><body class="lt-ie9"><![endif]-->

http://bpaste.net/show/110613/

http://bpaste.net/show/110612/

like image 763
brad Avatar asked Jun 28 '13 22:06

brad


3 Answers

In version 4 it used to be

//= require jquery.ui.all

But from version 5.0:

application.js:

  //= require jquery-ui

application.css:

  /*
   *= require jquery-ui
  */
like image 183
Karan Purohit Avatar answered Nov 19 '22 19:11

Karan Purohit


In order to require assets from jQuery UI, you need to install it first.

In Gemfile, add:

gem 'jquery-ui-rails'

Then run bundle install and restart the rails server.

like image 24
Domon Avatar answered Nov 19 '22 17:11

Domon


I have faced the same problem..

What happened to my project is, my gemfile.lock got updated and it was set to use the latest version of all the gems..

In case of jquery-ui-rails 4.2.1 we have been using 4.2.1 and by mistake gemfile.lock got updated and used the 5.0.2.

In jquery-ui-rails 5.0.2 the file jquery.ui.all.js is no more available.

So I was facing the error couldn't find file 'jquery.ui.all'

So to avoid such errors I prefer to use the tilde sign for version number in gemfile
Example:

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

~> makes the bundler to update the gem until version reaches to 4.2.9 and wont update if version reaches to 4.3.0

  • You know that if drastic changes occur in the gem then version number must reach 4.3.0
  • Update the gem if you know what changes have been made exactly and you are ready to upgrade.
like image 6
illusionist Avatar answered Nov 19 '22 17:11

illusionist