24

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/

1

5 Answers 5

35

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
  */
4
  • This solved my problem when pulling a production environment to a new development environment. Thanks! Accepted answer does not seem to have anything to do with question. Feb 25, 2015 at 16:19
  • I was stuck in similar situation, and it worked for me, Thanks for accepting. Feb 26, 2015 at 6:16
  • Thanks, that was the solution to me
    – simo
    Mar 20, 2015 at 18:44
  • this should be the accepted answer not the one the OP wrote and accepted. ugh Nov 2, 2018 at 20:58
11

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.

3
  • 1
    For me, I tried to do group :assets do gem 'jquery-ui-rails' end. When I took the gem statement out of the group, my code started working.
    – Kevin
    Jul 18, 2013 at 16:24
  • 4
    @Kevin Yes, it must be placed outside of the assets group. And by the way, there is no :assets group anymore in Rails 4.
    – Domon
    Jul 19, 2013 at 0:34
  • 1
    See the end of section guides.rubyonrails.org/… in case you are using :assets group. You might need to edit Bundler.require call in your config/application.rb.
    – Tero Tilus
    Sep 23, 2013 at 9:18
6

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.
1
2

Restart the server to fix this issue.

Worked for me.

1
  • I can't believe this was the solution... Thanks!
    – Jeff
    Jun 25, 2014 at 17:54
-6

actually the solution was to clone a fresh copy of my repo an run

bundle install --without production
bundle exec rake db:migrate
bundle exec rake db:seed
rails s

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.