Compressing images

As the documentation recommends, I tried following the instructions to install middleman-imageoptim but get the following errors when I run middleman:

:image_optim is deprecated. Please use `:imageoptim` instead.
== The Middleman is loading
/home/kiffin/.rvm/gems/ruby-2.3.1/gems/middleman-imageoptim-0.2.1/lib/middleman-imageoptim/resource_list.rb:68:in `resource_build_path': undefined method `build_dir' for #<Middleman::Application:0x33921860> (NoMethodError)
Did you mean?  build?

I think you better find the Github repo for the extension and create an issue over there (that you could link over here :wink: ).

Turns out that there is still not a version ready for MM4.

1 Like

@kgish, I ran into this same issue and reported it on the repo here: https://github.com/plasticine/middleman-imageoptim/issues/51

I found a forked version of the gem that fixes the issue, and referenced it on that issue as well. Basically, just change your call to middleman-imageoptim in your Gemfile to this:

gem "middleman-imageoptim", "~> 0.2.1", :git => "https://github.com/georgecheng/middleman-imageoptim"

…then bundle install and try to build again.