Coder Social home page Coder Social logo

ruby-clean-css's People

Contributors

joseph avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ruby-clean-css's Issues

NoMethodError: undefined method `new'

I just deleted and recloned my Rails app. I've been using ruby-clean-css for CSS minification for a while now and it's all been great, but now all of a sudden I'm getting this:

% bundle exec rake assets:precompile RAILS_ENV=production
rake aborted!
NoMethodError: undefined method `new' for #<RubyCleanCSS::Compressor:0x00000 812414de8 @js_options={}>
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-3.2.0/lib/sprockets/ legacy_tilt_processor.rb:25:in `call'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-3.2.0/lib/sprockets/ processor_utils.rb:75:in `call_processor'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-3.2.0/lib/sprockets/ processor_utils.rb:57:in `block in call_processors'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-3.2.0/lib/sprockets/ processor_utils.rb:56:in `reverse_each'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-3.2.0/lib/sprockets/ processor_utils.rb:56:in `call_processors'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-3.2.0/lib/sprockets/ loader.rb:86:in `load_asset_by_uri'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-3.2.0/lib/sprockets/ loader.rb:45:in `block in load'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-3.2.0/lib/sprockets/ loader.rb:155:in `fetch_asset_from_dependency_cache'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-3.2.0/lib/sprockets/ loader.rb:38:in `load'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-3.2.0/lib/sprockets/ cached_environment.rb:20:in `block in initialize'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-3.2.0/lib/sprockets/ cached_environment.rb:47:in `yield'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-3.2.0/lib/sprockets/ cached_environment.rb:47:in `load'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-3.2.0/lib/sprockets/ base.rb:63:in `find_asset'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-3.2.0/lib/sprockets/ base.rb:70:in `find_all_linked_assets'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-3.2.0/lib/sprockets/ manifest.rb:130:in `block in find'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-3.2.0/lib/sprockets/ manifest.rb:129:in `each'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-3.2.0/lib/sprockets/ manifest.rb:129:in `find'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-3.2.0/lib/sprockets/ manifest.rb:162:in `compile'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-2.3.1/lib/spro ckets/rails/task.rb:70:in `block (3 levels) in define'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-3.2.0/lib/rake/sproc ketstask.rb:147:in `with_logger'
/home/example/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-2.3.1/lib/spro ckets/rails/task.rb:69:in `block (2 levels) in define'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

environments/production.rb

config.assets.css_compressor = :cleancss

Gemfile

gem "ruby-clean-css"

execjs support

So after doing a bunch of research, clean-css is great. I'm currently using this gem in voltframework - https://github.com/voltrb/volt ) My users on windows are having trouble installing libv8, and it would be great if the windows users could use a different JS runtime. I'm not sure if there's libv8 specific features your using, but if your interested in adding execjs support, let me know and maybe I or someone else from the volt community could help.

Thanks!

uninitialized constant RubyCleanCSS::Exports::Http::OpenSSL (V8::Error)

I'm getting this error, probably with RubyCleanCSS::Compressor#compress:

/home/user/.gem/ruby/2.2.0/gems/ruby-clean-css-1.0.0/lib/ruby-clean-css/exports.rb:202:in `block in initialize': uninitialized constant RubyCleanCSS::Exports::Http::OpenSSL (V8::Error)
        from at Inliner.inlineRemoteResource (/home/user/.gem/ruby/2.2.0/gems/ruby-clean-css-1.0.0/lib/javascript/clean-css/lib/imports/inliner.js:224:5)
        from at Inliner.inline (/home/user/.gem/ruby/2.2.0/gems/ruby-clean-css-1.0.0/lib/javascript/clean-css/lib/imports/inliner.js:191:12)
        from at Inliner.process (/home/user/.gem/ruby/2.2.0/gems/ruby-clean-css-1.0.0/lib/javascript/clean-css/lib/imports/inliner.js:71:9)
        from at /home/user/.gem/ruby/2.2.0/gems/ruby-clean-css-1.0.0/lib/javascript/clean-css/lib/clean.js:65:63
        from /home/user/.gem/ruby/2.2.0/gems/ruby-clean-css-1.0.0/lib/ruby-clean-css/exports.rb:22:in `block in nextTick'
        from at CleanCSS.minify (/home/user/.gem/ruby/2.2.0/gems/ruby-clean-css-1.0.0/lib/javascript/clean-css/lib/clean.js:64:12)
        from /home/user/.gem/ruby/2.2.0/gems/ruby-clean-css-1.0.0/lib/ruby-clean-css/compressor.rb:16:in `compress'
        from ../_tools/compress-css.rb:28:in `block in main'
        from ../_tools/compress-css.rb:26:in `each'
        from ../_tools/compress-css.rb:26:in `main'
        from ../_tools/compress-css.rb:33:in `<main>'

But adding require 'openssl' to ruby-clean-css/exports.rb fixes it. I'm using ruby 2.0, 2.1 and 2.2.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.