Rails error include jquery.ui.all - jquery-ui

I have an error when I try to include jquery.ui.all. All worked perfectly befor that I reboot my computer but now I have this error :
couldn't find file 'jquery.ui.all'
I rebooted my server, I try to clear the cache from the Rails console and on my navigators and I still have the problem. I also tried to to delete the Gemfile.lock and run bundle install and still the same error.
Here my both application.js and application.css :
//= require ./plugins/jquery-1.10.2.min
//= require jquery_ujs
//= require fullcalendar
//= require jquery.ui.all
//= require ./plugins/jquery-migrate-1.2.1.min
//= require ./plugins/bootstrap/js/bootstrap.min
//= require turbolinks
//= require underscore-min
//= require gmaps_google
*= require_self
*
* CSS Global Compulsory
*= require ./plugins/bootstrap/css/bootstrap.min
*= require style
*
* CSS Implementing Plugins
*= require ./plugins/line-icons/line-icons
*= require ./plugins/font-awesome/css/font-awesome.min
*= require ./plugins/flexslider/flexslider
*= require ./plugins/bxslider/jquery.bxslider
*= require ./plugins/layer_slider/css/layerslider
*= require ./plugins/hover-effect/css/custom-hover-effects
*= require ./plugins/sky-forms/version-2.0.1/css/custom-sky-forms
*
* CSS Theme
*= require ./themes/orange.css
*
* CSS Customization
*= require custom
*= require fullcalendar
*= require jquery.ui.all
*/
And my Gemfile :
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.2'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use mysql2 as the database for Active Record
gem "mysql2", "~> 0.3.15"
# gem "mysql2", "0.3.11"
# Use PostgreSql at the database for Active Record
gem "pg"
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'jquery-ui-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Bundle Pagination
gem 'will_paginate', '~> 3.0'
gem 'will_paginate-bootstrap'
# Authentification, Authorize, Roling
gem 'omniauth'
gem 'devise'
gem 'omniauth-google-oauth2'
gem 'cancan'
gem 'rolify', :git => "git://github.com/EppO/rolify.git"
# Géolocalisation
gem 'geocoder'
gem 'gmaps4rails'
# API Builder
gem 'rabl'
# Json Parser
gem 'oj'
# Upload de Fichier
gem "paperclip", "~> 4.1"
# Fullcalendar
gem 'fullcalendar-rails'

Ok I find the problem,
The problem is from the update of the gem jquery-ui-rails. Befor the include was :
jquery.ui.all
and now :
jquery-ui
Hope that it can me helpful

Related

How to disable Turbolinks on Heroku?

First, I removed gem 'turbolinks' and removed the code requiring Turbolinks in the application.js file. So, I successfully disabled Turbolinks in my local machine. Then, I pushed my changes to Heroku, but Turbolinks is still working in production.
How can I disable Turbolinks in Heroku?
When I ran this code:
heroku run cat app/assets/javascripts/application.js
I got following code:
//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 any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require jquery-ui/effects/effect-highlight
//= require bootstrap
//= require material
//= require materialize-sprockets
//= require custom
//= require cocoon
//= require underscore
//= require_tree .
Also, my Gemfile looks like this on the production environment:
source 'https://rubygems.org'
gem 'rails', '4.2.2'
gem 'bcrypt', '3.1.7'
gem 'faker', '1.4.2'
gem 'carrierwave', '0.10.0'
gem 'mini_magick', '3.8.0'
gem 'fog', '1.36.0'
gem 'will_paginate', '3.0.7'
gem 'bootstrap-will_paginate', '0.0.10'
gem 'bootstrap-sass', '3.2.0.0'
gem 'sass-rails', '5.0.6'
gem 'uglifier', '2.5.3'
gem 'materialize-sass'
gem 'coffee-rails', '4.1.0'
gem 'jquery-rails', '4.0.3'
gem 'jbuilder', '2.2.3'
gem 'sdoc', '0.4.0', group: :doc
gem 'omniauth-facebook'
gem 'figaro'
gem 'material_design_lite-sass'
gem 'material_icons'
gem "font-awesome-rails"
gem 'cocoon'
gem 'simple_form'
gem 'jquery-ui-rails'
gem 'activerecord-reset-pk-sequence'
gem 'underscore-rails'
group :development, :test do
gem 'sqlite3', '1.3.9'
gem 'byebug', '3.4.0'
gem 'web-console', '2.0.0.beta3'
gem 'spring', '1.1.3'
gem "better_errors"
gem "binding_of_caller"
end
group :production do
gem 'pg', '0.17.1'
gem 'rails_12factor', '0.0.2'
gem 'puma', '3.1.0'
end
I have also removed all Turbolinks references in application.html.erb.
But still, Turbolinks isn't being disabled in production environment. What can be the fix?
Note: Turbolinks is successfully disabled in my development environment.
Make "data-turbolinks-track" => false in file app/views/layouts/application.html.erb
Basically straight from here. It's for Rails 4, but I believe the steps are the same.
1) Remove the gem 'turbolinks' line from your Gemfile.
2) Remove the //= require turbolinks from your app/assets/javascripts/application.js .
3) Remove the two "data-turbolinks-track" => true hash key/value pairs from your app/views/layouts/application.html.erb .

couldn't find file 'jquery.ui.core' in rails 4 while trying to change design look of the datatable

This is the application.css
*= require bootstrap
*= require jquery.ui.core
*= require jquery.ui.theme
*= require dataTables/src/demo_table_jui
*= require admin/taluks
*= require bootstrap-submenu.min
This is the application.js
//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require bootstrap.min
//= require bootstrap-submenu.min
//= require dataTables/jquery.dataTables
//= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
//= require jquery-ui/datepicker
//= require data-confirm-modal
//= require admin/taluks
//= require admin/ceos
//= require admin/progress_charters
//= require admin/societies
//= require turbolinks
This is the gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.6'
# Use sqlite3 as the database for Active Record
gem 'mysql2'
gem 'devise'
gem "cancan"
gem 'carrierwave'
gem "mini_magick"
gem 'data-confirm-modal', github: 'ifad/data-confirm-modal'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
gem 'jquery-datatables-rails', '~> 3.1.1'
# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'jquery-ui-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', group: :development
gem 'bootstrap-sass', '~> 3.2.0'
gem 'autoprefixer-rails'
I tried downgrading jquery-rails to 'jquery-rails', "~> 2.3.0". But it's not helping. I restarted server. Cleaned assets and cleaned bundle
I had the same issue than you right now with the latest version of query-ui-rails. I suppose that you followed the railscast on datable, if so then I invite you to the query-rails-ui Github. The rails cast is a bit outdated.
Now if you want to include specific module you would have to write:
*= require jquery-ui/core
*= require jquery-ui/theme

couldn't find file 'jquery-ui' i get this error even after having this file in my application.js

I am trying to add a jquery ui datepicker to my application and getting this error
couldn't find file 'jquery-ui'
(in /home/sumyvps/rails_projects/Expense_book/app/assets/javascripts/application.js:18)
I tried instructions in many links but not getting the solution to this.
my Gemfile is as
source 'https://rubygems.org'
ruby '1.9.3'
#ruby-gemset=railstutorial_rails_4_0
gem 'rails', '4.0.8'
gem 'bootstrap-sass', '3.2.0.0'
gem 'sprockets', '2.11.0'
gem 'bcrypt-ruby', '3.1.2'
gem 'will_paginate', '3.0.7'
gem 'bootstrap-will_paginate', '0.0.10'
gem 'jquery-ui-rails', '~> 4.2.1'
group :development, :test do
gem 'sqlite3', '1.3.8'
gem 'rspec-rails', '2.13.1'
end
group :test do
gem 'selenium-webdriver', '2.35.1'
gem 'capybara', '2.1.0'
end
gem 'sass-rails', '4.0.3'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
group :doc do
gem 'sdoc', '0.3.20', require: false
end
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor', '0.0.2'
end
application.css file is as below
*= require_self
*= require_tree .
*= require jquery.ui.datepicker
*= require jquery.ui.core
*= require jquery.ui.theme
application.js is as
//= require turbolinks
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require_tree .
//= require jquery-ui
//= require jquery.ui.datepicker
someone please help...
As you are using gem 'jquery-ui-rails', '~> 4.2.1' You must include //= require jquery.ui.all in js and *= require jquery.ui.all in css instead of //= require jquery.ui & *= require jquery.ui
Because //= require jquery.ui & *= require jquery.ui are present after 'jquery-ui-rails', '~> 5.0.0' this is not present in 'jquery-ui-rails' 4.x.x version.
See more document changes here for 4.x.x and here for 5.x.x

ActionView::Template::Error (couldn't find file 'dataTables/src/demo_table_jui'

I am trying to show a paginated list of results back from a database and have ended up looking at using dataTables. I have been following rails cast 340 but hit a problem with the above error. I am running rails 3.1.12.
My files are as follows:
Gemfile:
source 'http://rubygems.org'
gem 'rails', '3.1.12'
gem 'sqlite3'
group :assets do
gem 'sass-rails', '~> 3.1.5'
gem 'coffee-rails', '~> 3.1.1'
gem 'therubyracer'
gem "less-rails"
gem 'uglifier', '>= 1.0.3'
gem 'jquery-datatables-rails', github: 'rweng/jquery-datatables-rails'
gem 'jquery-ui-rails'
end
gem 'jquery-rails'
gem 'savon', '2.5.1'
gem 'twitter-bootstrap-rails'
gem 'will_paginate'
application.js:
//= require jquery
//= require jquery.ui.all
//= require dataTables/src/demo_table_jui
//= require_tree .
application.cs
*= require_self
*= require dataTables/jquery.dataTables
*= require_tree .
nettica.coffee.js
jQuery ->
$('#domains').dataTable
sPaginationType: "full_numbers"
Any ideas?
Further on down the line I also get problems with adding:
bJQueryUI: true
to the above file.
Thank you

Datatable works in development mode, but doens't work in production - assets

I have a problem, I think my problem is with assets, because it works in Development environment but does not work in Production.
I'm using DataTables in my app, it's works in development mode.
I follow all steps in this link:
https://github.com/rweng/jquery-datatables-rails
I searched for answers and I found many posts. I tried all, but still could not solve the issue.
P.S.: If I execute: RAILS_ENV=production bundle exec rake assets:precompile, datatable stops working in development mode too.
in Gemfile:
source 'https://rubygems.org'
gem 'rails', '~> 3.2.16'
gem 'mysql2', '~> 0.3.14'
# Autenticação
gem 'authlogic', '~> 3.3.0'
# Autorização
gem 'cancan'
# Anexos
gem 'paperclip', '~> 3.0'
# Mailer
gem 'mail', '~> 2.5.4'
# Custom select
gem "bootstrap-select-rails", "~> 1.3.0"
#
gem 'whenever', :require => false
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '~> 1.0.3'
gem 'therubyracer', '~> 0.12.0'
end
gem 'jquery-datatables-rails', github: 'rweng/jquery-datatables-rails'
gem 'less-rails'
gem 'jquery-rails'
gem 'jquery-ui-rails', '~> 4.1.1'
# twitter bootstrap css & javascript toolkit
gem 'twitter-bootswatch-rails', '~> 3.0.3'
# twitter bootstrap helpers gem, e.g., alerts etc...
gem 'twitter-bootswatch-rails-helpers'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
assets/javascripts/aplication.js
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require jquery.ui.all
//= require jquery.ui.tabs
//= require jquery.ui.tabs.min
//= require bootstrap-tabs
//= require interns
//= require systems_analysts
//= require generics
//= require file_field
//= require bootstrap-filestyle
//= require dataTables/jquery.dataTables
//= require dataTables/jquery.dataTables.bootstrap
//= require cocoon
assets/javascripts/interns.js
// Ordenação dos Grids por coluna
$(document).ready(function() {
$('#hr_curriculum_interns').dataTable({
"aoColumnDefs": [ // Ordenação desativada nas colunas com actions
{ 'bSortable': false, 'aTargets': [ 5, 6, 7, 8 ] }
],
"bPaginate": false,
"bFilter": false,
"bInfo": false
});}
);
assets/stylesheets/application.css
/* Cerulean
* Bootswatch
*= require_self
*= require jquery.ui.all
*= require cerulean/loader
*= require cerulean/bootswatch
*= require_tree ./custom/
*= require jquery.ui.theme
*= require jquery.ui.core
*= require dataTables/jquery.dataTables.bootstrap
*/
Any idea please?
Your issue is probably because of Rails Asset pipelining in production.
Try this..........
In config/initializers
config.assets.precompile += %w( *.js *.css )
and In environments/production.rb
config.serve_static_assets = true
then
RAILS_ENV=production rake assets:precompile
then check
RAILS_ENV=production rails s

Resources