Assets Precompiling Error with Jquery UI Plugin

Rails Asset Pipeline problems with jquery-ui

I solved this problem by creating a testing controller with a specific layout.

Read more hear to create a specific layout
rails assets in production not served (yet another assets issue)

In this layout I would use cdn version of jquery and jquery-ui and as it would work with CDN and not with the jquery-ui gem, I understood that a first problem was with the gem.

Downloading jquery-ui (which included also jquery files) and including jquery and jquery-ui in my vendor/assets/javascripts and stylesheets solved the problem

The other javascript files would not cause any other problem, but using this testing controller to test also the stylesheets, I discovered that a specific custom css stylesheet was breaking the jquery-ui effect.

I could solve this problem by removing the stylesheet, but a lot of nice effect where there included (as I am using a layout).

At this point i just started with chrome developer tools to uncomment all the css properties that the link had, so that I found out, by testing the effect which property was creating problems

For example the css property that did create conflicts was with the a tag

a {
color: #28c3ab;
-webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}

Sample Image

trouble with precompile on heroku cedar with jquery ui file

This could be two things. If you're trying to link direct to the asset from your views then you need to set it to pre-compile:

http://neilmiddleton.com/precompiling-non-default-assets-with-rails-3/

If, however, it's just in the tree and you're expecting it to be included with application.css then you need to ensure that it's either in the manifest directly, or in one of the included trees if there are any listed.

for instance (application.css):

/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require "reset"
*= require "base"
*= require "jquery-ui-1.8.18.custom"
*/

Error can't load css vs javascript when run rake assets:precompile on rails 4.2.0

In rails previously the assets were placed in public folder but now all the assets are located in the assets folder. The setting:

config.assets.compile = true

makes the live compilation enabled. In the live compilation all the assets are handled by sprockets. In the first time the assets is cached and compiled and their names are altered using a MD5 hash.

Now you have precompiled assets which gets stored in the public folder and to server assets from public folder you need to set:

config.serve_static_files = true

So set it to true and restart the server and check again.

More details:

http://guides.rubyonrails.org/asset_pipeline.html#in-production

rails 4.2 assets precompilation issue

Thanks to Wishalizer suggestions, i've finally solved this issue...

the error is related to the Gemfile structure.... i've modified it as follows......

file: 'Gemfile'

source 'http://rubygems.org'

gem 'rails', '4.2.5'

gem 'mysql2', '0.3.17'
gem 'bcrypt-ruby', :require => 'bcrypt'
gem 'declarative_authorization', :git => 'git://github.com/stffn/declarative_authorization'
gem 'ruby_parser'
gem 'jQuery-Validation-Engine-rails'
gem 'prawn', '1.3.0'
gem 'prawn-table', '0.2.1'

# gem 'bootstrap-sass', '~> 3.1.1'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier'

gem "therubyracer"
gem "less-rails", :git => 'git://github.com/metaskills/less-rails', :ref => '539f28d'

end

gem 'twitter-bootstrap-rails', :git => 'git://github.com/coppolaf/tb3-rails4.git'

gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'jquery-datatables-rails' , :git => 'git://github.com/rweng/jquery-datatables-rails'
gem 'will_paginate'
gem 'nokogiri'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

group :test do
# Pretty printed test output
gem 'turn', '~> 0.8.3', :require => false
end

moving the references to jquery-ui-rails and jquery-datatables-rails outside the assets section...
enables the assets precompilation task to complete without errors!!

hoping this to be helpful....

bye
francesco

Unable to use jQuery plugin placed in the Ruby on Rails vendor folder

I have located the source of the problem, which was an issue with the knob.js and kontrol.js libraries themselves. The libraries were failing to parse due to an error in the current distribution files, which was in turn causing the jQuery to fail to work intermittently, as the browser attempting to include the plugins and failing seems to have interfered with the interpreting of the jQuery code itself. Once I removed these, jQuery worked fine.

I have now added a different js library which is working without issue.

Rails 3.1.3 unable to access the file inside assets/javascripts folder

Simply use the fancy box gem https://github.com/hecticjeff/fancybox-rails



Related Topics



Leave a reply



Submit