1
votes

I have installed spree gem to my rails project and I got this error couldn't find file 'jquery.ui.all' I saw too many problems, and solutions for that but I didn't get any solution yet. My rvm version:

rvm list

ruby-2.0.0-p353 [ x86_64 ]

=* ruby-2.2.0 [ x86_64 ]

Rails version: Rails 4.1.8

Here is my view error page:

Sprockets::FileNotFound in Spree::Home#index
Showing /home/sadk/.rvm/gems/ruby-2.2.0/gems/spree_frontend-2.4.2/app/views/spree/shared/_head.html.erb where line #11 raised:

couldn't find file 'jquery.ui.all'
  (in /home/sadk/.rvm/gems/ruby-2.2.0/bundler/gems/spree_fancy-bdeaeb9ced29/app/assets/javascripts/spree/fancy.js:3)
Extracted source (around line #11):

   <%= stylesheet_link_tag 'spree/frontend/all', :media => 'screen' %>

   <%= stylesheet_link_tag 'spree/fancy/print', :media => 'print' %><%= csrf_meta_tags %>
   <%= javascript_include_tag 'spree/frontend/all' %>
   <!--[if lt IE 9]>
     <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6/html5shiv.min.js"></script>
   <![endif]-->

<%= javascript_include_tag 'spree/frontend/all' %> is 11th line which has error.

I tried to add

//= require jquery.ui.all

to my application.js but the problem is same. Could you help me about what I should do?

after bundle I can see these lines in the list

 ...
 Using jquery-rails 3.1.2
 Using jquery-ui-rails 5.0.3 
 ...
3

3 Answers

0
votes

So how are you including jquery in your project?

Instead of

//= require jquery.ui.all

Try

//= require jquery.ui

and remember to bundle install

0
votes

I think the problem is that some spree versions does not include jquery-ui-rails gem so you need to add it to your gemfile: gem 'jquery-ui-rails'

0
votes

I solved it by doing little change in fancy.js

Instead of

//= require jquery.ui.all

I added

//= require jquery-ui

then restart server

That's it.