SameShirtEveryDay.com

Personal blog of the one called Alex Gorbatchev, from Toronto, Canada.

Zlib:BufError while installing Capistrano on Windows

Posted on May 22nd, 2007 by Alex Gorbatchev. In Rails, Ruby. 15 comments!

It’s time to dive into Capistrano and I can’t find any good get started tutorial.

Funny enough, I couldn’t even gem install capistrano. Apparently, on Windows, it’s common to be getting ERROR: While executing gem … (Zlib::BufError) buffer error.

To fix the problem I had to run gem update --system. Twice, because the first time it failed.

Thnx to don’t repeat yourself.

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

15 comments.

  1. Thanks, I thought it was something wrong with ruby so I reinstalled everything. I wish I had read this first.

  2. Thank you Alex!!! This fixed it for me.

  3. Stuart

    Thanks Alex. This solved another gem installation failure for me.
    Looking around the web this problem seems to be prevalant for anyone on windows running a 0.9.2 version of ruby gems (type `gem environment` to find out what’s running). After updating everything went smoothly. Cheers

  4. Bob

    Appreciate it Alex–solved my problem!

  5. This is exactly what I needed to get Capistrano to install on Windows XP. Thank you!

  6. Jan M

    Ok, after two times “gem update –system” I still had the same error. It also suddenly wanted to update gems that were already up to date. So I did a reinstall of Ruby, then the two updates and then it worked.

    I tracked down the cause of the screwed up installation and it turned out to be the preview version of capistrano 2! Be warned. Before I figured this out I had done 5 clean Ruby installs…

    So, although the tutorial on their site tell you, DON’T DO:
    gem install -s http://gems.rubyonrails.com capistrano

  7. srboisvert

    I am getting a bit different error.

    I have instant rails installed and it works fine.

    I’ve installed the Capistrano gem and it indicates success but as soon as I test it with cap -h. it throws up an error:

    C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/capistrano
    ui.rb:5: undefined method `track_eof=’ for HighLine:Class (NoMethodError)

    I’ve updated several times – each time it says:
    Updating RubyGems…
    Need to update 1 gems from http://gems.rubyforge.org
    .
    complete
    Attempting remote update of rubygems-update
    Successfully installed rubygems-update-0.9.4
    Updating version of RubyGems to 0.9.4
    Installing RubyGems 0.9.4

    and indicates everything went fine.

    I’m a bit frustrated since nobody else seems to have this error.

  8. Alex Gorbatchev

    Seems like the error is referring to highline gem. See if you have it and maybe install/update.

    http://rubyforge.org/projects/highline/

  9. srboisvert

    Thanks Alex. That did the job. Now on to the hard work! Up, up and away!

  10. This turns out to be a very general problem with Zlib on Ruby for Windows. I’ve written up the code that allows you to work around it:

    http://www.misuse.org/science/2007/09/07/ruby-zlib-buffer-error-on-windows/

    Basically the core is from the RubyGems guys (Jamis Buck I think). I’ve just published the code if anyone needs to know how to avoid buffer errors in the Zlib Ruby library in other places on Windows.

  11. george

    Thanks mate for your tip!!

  12. This works also when installing Rails from RubyGems:

    gem update –system
    gem update –system
    gem install rails –include-dependencies

    Thx again, Alex.

  13. first of all,. check your ruby bin folder for zlib.dll
    in mine case there was zlib1.dll , so instead of renaming the zlib1.dll , i copied it with different name zlib.dll
    and that solved the issue.

Leave a Reply

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> , rel="nofollow" in use - no link dropping, no keywords or domains as names; do not spam, and do not advertise!

home
Subscribe to this blog Follow me on Twitter My bookmarks on Delicious My photography on Flickr