Sprockets::FileNotFound couldn't find file 'jquery-fileupload/basic' - ruby-on-rails

I am attempting to upload multiple pictures with jquery file upload. In my application.js file I added //= require jquery-fileupload/basic and in my Gemfile I added jquery-fileupload-rails under the assets group. This causes the error: couldn't find file jquery-fileupload/basic. I have reset my rails server and checked for spaces in application.js however the error stays. Any help would be greatly appreciated
application.js
//= require jquery
//= require jquery_ujs
//= require jquery-fileupload/basic
//= require jquery.ui.datepicker
//= require jquery.ui.tooltip
//= require jquery-ui-1.10.4.custom.min
//= require jquery.timepicker.min
//= require bootstrap/dropdown
//= require bootstrap/modal
//= require raty
//= require_tree .
gemfile
gem 'byebug', '~> 3.5.1'
gem 'rails', '4.0.3'
gem 'pg'
gem 'bootstrap-sass', '~> 3.1.1'
gem 'devise'
gem 'faker'
gem 'geocoder'
gem 'carrierwave'
gem 'mini_magick'
gem 'figaro'
gem 'state_machine'
gem 'jquery-ui-rails', '~> 4.2.1'
gem 'rails_12factor'
gem 'elasticsearch-model'
gem 'simple_form'
gem 'omniauth-facebook'
gem 'omniauth-linkedin'
gem 'omniauth'
gem 'pry-rails'
group :development, :test do
gem 'rspec-rails', '2.13.1'
gem 'quiet_assets'
# gem 'pry-debugger'
gem 'meta_request'
gem 'interactive_editor'
gem 'hirb'
gem 'quiet_assets'
gem 'awesome_print'
end
#
group :test do
gem 'selenium-webdriver', '2.35.1'
gem 'capybara', '2.1.0'
gem 'factory_girl_rails', '4.2.1'
end
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
group :assets do
gem 'jquery-ui-rails', '~> 4.2.1'
gem 'jquery-fileupload-rails'
end

put it outside the assets group and run bundle install.
btw jquery-ui-rails does not belong there either

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' 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

Foundation 5 - Rails 4 css topbar not working

I am having an issue with foundation 5, rails 4.1.0, as per screenshot, links are underlined, search box is off.
I have created a separate dummy rails app with the same spec and don't see the same issue
I've tried without turbolinks, and different topbar configurations.
any ideas where to troubleshoot this?
Screenshot:
http://postimg.org/image/ohtwc60rj/
application.js
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require foundation
//= require_tree .
$(function() {
$(document).foundation();
});
`
application.css.scss
*= require_tree .
*= require_self
*/
gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.0'
# Use sqlite3 as the database for Active Record
#gem 'sqlite3'
# 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
# Use jquery as the JavaScript library
gem 'jquery-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'
gem 'foundation-rails'
gem 'rails_12factor'
gem 'activeadmin', github: 'gregbell/active_admin'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
group :development do
#gem 'sqlite3'
gem 'rspec-rails'
gem 'guard-rspec'
gem 'slop'
gem 'guard-livereload', require: false
gem 'jazz_hands'
end
gem 'pg', '0.17.1'
group :test do
gem 'rspec-rails'
gem 'capybara'
gem 'rb-fsevent', :require => false
gem 'growl'
gem 'guard-spork', :github => 'guard/guard-spork'
gem 'spork', :github => 'sporkrb/spork'
end
#Server monitoring
gem 'newrelic_rpm'
Found that active admin was conflicting. commented out active_admin.css.scss resolved the issue. That put me in the right direction
Fix from Foundation when using active admin http://foundation.zurb.com/forum/posts/1359-foundation-5-impacted-by-active-admin-on-rails-4

couln't find file 'chosen-jquery' error during deploy

I am trying to deploy an app in rails 3.2.16, with capistrano on a vps. This is my first time doing that. During the deployment process, I get the following error: "couldn't find file "chosen-jquery" '. The rpoblem is that my gem versions and generally the whole environment is the same on the server and my testing machine. I get the error during the "assets:precompile" command execution.
Any suggestions?
I am using the gem chosen -v 1.0.2, rails 3.2.16 and Ruby 1.9.3.
Here is my gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.16'
gem 'mysql2'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'ckeditor', '4.0.4'
gem 'carrierwave', '0.8.0'
gem 'devise', '2.2.3'
gem 'globalize3', '0.3.0'
gem 'babosa', '0.3.9'
gem 'haml', '4.0.4'
gem 'friendly_id', '4.0.9'
gem 'simple_form', '2.0.4'
gem 'kaminari', '0.14.0'
gem 'nokogiri', '1.6.1'
gem 'jquery-fileupload-rails', '0.4.0'
gem 'ancestry', '1.3.0'
gem 'ransack', '0.7.2'
gem 'simple-navigation', '3.10.0'
gem 'mime-types', '~>1.21'
gem 'mini_magick', '3.5.0'
gem 'acts_as_list', '0.1.9'
gem 'chosen-rails'
gem 'pry'
gem 'passenger'
and my application.js manifest:
//= require jquery-1.10.2.min
//= require jquery_ujs
//= require ckeditor/init
//= require jquery.fancybox-1.3.4.pack
//= require jquery.easing-1.3.pack
//= require jquery.mousewheel-3.0.4.pack
//= require chosen-jquery
//= require scripts
//= require admin_scripts
Thank you in advance for your time and effort :)
You can try require the library manually (as file)
Just restart rails server. I had the same problem on Rails 4.1.5. I restarted rails server and it worked. See this Github issue

Resources