rstacruz / sinatra-assetpack

Package your assets transparently in Sinatra.
http://ricostacruz.com/sinatra-assetpack/
MIT License
542 stars 96 forks source link

Sinatra::AssetPack::Error - Engine scss (css) doesn't exist. #177

Open thesmart opened 10 years ago

thesmart commented 10 years ago

When I run the asset builder (version 0.3.3) on OSX, I get the expected result. However, when I run on Ubuntu, I get the following error:

Sinatra::AssetPack::Error - Engine scss (css) doesn't exist.
vendor/bundle/ruby/2.1.0/gems/sinatra-assetpack-0.3.3/lib/sinatra/assetpack/compressor.rb:16:in `compress'
vendor/bundle/ruby/2.1.0/gems/sinatra-assetpack-0.3.3/lib/sinatra/assetpack/package.rb:94
[...]

I have require 'sass' at the top of my app.rb. Here is my assets block:

assets do
    serve '/js', :from => 'web/public/js'
    serve '/css', :from => 'web/public/css'

    # Js Packages
    require_relative './javascript'
    js :app, JavaScript::base_package

    # Css Packages
    css :stage_craft, [
      '/css/vendor/bootstrap-3.1.1.min.css',
      '/css/vendor/font-awesome-4.0.3.css',
      '/css/app.css'
    ]

    js_compression  :uglify, [:drop_console => true]
    css_compression :scss
end

The app.css is actually /public/css/app.scss

When I change the css_compression from :scss to :sass it works on Ubuntu but fails on OSX. Very odd that the gem has different behavior on different OS.

j15e commented 10 years ago

Weird, filename case sensitive issue? I don't see any quickly but sounds like it could be something like this. OSX is not case sensitive and Ubuntu is...

Error is at https://github.com/rstacruz/sinatra-assetpack/blob/master/lib/sinatra/assetpack/compressor.rb#L15

Not sure where @compressors are loaded, this is where you should look for additional clues.