middleman-imageoptim icon indicating copy to clipboard operation
middleman-imageoptim copied to clipboard

middleman build stops after enabling middleman-imageoptim

Open wkoszek opened this issue 10 years ago • 2 comments

My website is in the repo: https://github.com/wkoszek/me

I have CircleCi enabled: https://circleci.com/gh/wkoszek/me/57

Same config I use on MacOSX Yosemite with Brew. Before enabling middleman-imageoptim: everything works. After enabling: build stops on the 2nd .html file:

   identical  build/css/charter/webfonts/charter_bold_italic-webfont.eot
   identical  build/css/charter/webfonts/specimen_files/easytabs.js
== Request: /blog/2012/12/27/index.html
== Finishing Request: blog/2012/12/27/index.html (0.1s)
   identical  build/blog/2012/12/27/index.html
== Request: /blog/2013/04/03/book-ignore-everybody/index.html

After a while of waiting each time the file is processed, I get:

== Request: /blog/2013/04/05/book-titan/index.html
       error  build/blog/2013/04/05/book-titan/index.html
super: no superclass method `get_source_file' for #<Middleman::Imageoptim::ManifestResource:0x007facfe3d9890>
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/sitemap/extensions/proxies.rb:61:in `get_source_file'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/sitemap/resource.rb:33:in `source_file'
/w/repos/me/source/layouts/layout_book.erb:79:in `block (3 levels) in singleton class'
/w/repos/me/source/layouts/layout_book.erb:79:in `each'
/w/repos/me/source/layouts/layout_book.erb:79:in `find_all'
/w/repos/me/source/layouts/layout_book.erb:79:in `block (2 levels) in singleton class'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-more/core_extensions/default_helpers.rb:12:in `call'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-more/core_extensions/default_helpers.rb:12:in `capture_from_template'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-more/core_extensions/default_helpers.rb:64:in `capture_html'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/rendering.rb:429:in `wrap_layout'
/w/repos/me/source/layouts/layout_book.erb:1:in `block in singleton class'
/w/repos/me/source/layouts/layout_book.erb:-6:in `instance_eval'
/w/repos/me/source/layouts/layout_book.erb:-6:in `singleton class'
/w/repos/me/source/layouts/layout_book.erb:-8:in `__tilt_70190457234540'
/Library/Ruby/Gems/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `call'
/Library/Ruby/Gems/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `evaluate'
/Library/Ruby/Gems/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/rendering.rb:303:in `render_individual_file'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/rendering.rb:153:in `render_template'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/sitemap/resource.rb:127:in `block in render'
/Library/Ruby/Gems/2.0.0/gems/activesupport-4.1.13/lib/active_support/notifications.rb:161:in `instrument'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/util.rb:41:in `instrument'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/application.rb:235:in `instrument'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/sitemap/resource.rb:14:in `instrument'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/sitemap/resource.rb:100:in `render'
/Library/Ruby/Gems/2.0.0/gems/middleman-blog-3.5.3/lib/middleman-blog/blog_article.rb:40:in `render'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/request.rb:260:in `process_request'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/request.rb:210:in `block in call!'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/request.rb:209:in `catch'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/request.rb:209:in `call!'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/request.rb:195:in `call'
/Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/urlmap.rb:66:in `block in call'
/Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/urlmap.rb:50:in `each'
/Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/urlmap.rb:50:in `call'
/Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
/Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/lint.rb:49:in `_call'
/Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/lint.rb:37:in `call'
/Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:153:in `call'
/Library/Ruby/Gems/2.0.0/gems/rack-test-0.6.3/lib/rack/mock_session.rb:30:in `request'
/Library/Ruby/Gems/2.0.0/gems/rack-test-0.6.3/lib/rack/test.rb:244:in `process_request'
/Library/Ruby/Gems/2.0.0/gems/rack-test-0.6.3/lib/rack/test.rb:58:in `get'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/cli/build.rb:255:in `render_to_file'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/cli/build.rb:221:in `build_resource'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/cli/build.rb:213:in `each'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/cli/build.rb:213:in `execute!'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/cli/build.rb:128:in `invoke!'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/actions.rb:94:in `action'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/cli/build.rb:70:in `build'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/cli.rb:72:in `method_missing'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:29:in `run'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:126:in `run'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/cli.rb:20:in `start'
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.12/bin/middleman:18:in `<top (required)>'
/usr/bin/middleman:23:in `load'
/usr/bin/middleman:23:in `<main>'

How I enable it: https://github.com/wkoszek/me/blob/master/config.rb

Also tried simple :activate imageoptim, both in the global scope and the configure :build scope. Same result. Same result on the CircleCI host when I SSH there (they use GNU/Linux)

On Mac, when I run image_optim -r *, this is what I see:

[wkoszek-macbook:/w/repos/me] wk% image_optim -r .
pngout worker: `pngout` not found; please provide proper binary or disable this worker (--no-pngout argument or `:pngout => false` through options)
svgo worker: `svgo` not found; please provide proper binary or disable this worker (--no-svgo argument or `:svgo => false` through options)
optimizing: 100.0% (elapsed: 2s)
 5.17%  27.6K  ./build/css/charter/webfonts/specimen_files/charter_bold-cleartype.jpg
 4.76%  26.8K  ./build/css/charter/webfonts/specimen_files/charter_bold_italic-cleartype.jpg
 4.38%  24.5K  ./build/css/charter/webfonts/specimen_files/charter_italic-cleartype.jpg
 4.88%  25.8K  ./build/css/charter/webfonts/specimen_files/charter_regular-cleartype.jpg
 3.60%   1.7K  ./build/img/2015-07-19-optimize-for-developers-time/image01.jpg
 3.60%   1.7K  ./build/img/2015-07-19-optimize-for-developers-time/image02.jpg
 ...
 2.11%   538B  ./source/img/2015-09-08-copyright-screen-of-facebook-paper/image56.jpg
 2.30%   680B  ./source/img/2015-09-08-copyright-screen-of-facebook-paper/image57.jpg
 1.87%   441B  ./source/img/2015-09-08-copyright-screen-of-facebook-paper/image59.jpg
 2.83%   803B  ./source/img/2015-09-08-copyright-screen-of-facebook-paper/image61.jpg
16.94% 124.2K  ./source/img/IMG_1394.jpg
 0.26%    38B  ./source/img/sharp_mfp.jpg
43.56%  18.7K  ./source/img/small_IMG_1394.jpg

wkoszek avatar Sep 10 '15 07:09 wkoszek

Applied a workaround:

https://github.com/wkoszek/me/commit/f7fc5301057bb6d2cef08ee8b3221dc685d07bc7

and it seems like it's working.

What's does the manifest feature actually do? Should we make it be easier to use out of the box?

wkoszek avatar Sep 10 '15 07:09 wkoszek

+1

akshayrawat avatar Sep 16 '15 12:09 akshayrawat