Zlib:BufError
May 14, 2007
So, I started installing Capistrano yesterday using:
gems install capistrano
Annoyingly, the net-ssh dependency failed with the hideous error message:
ERROR: While executing gem … (Zlib::BufError) buffer error
This seems to only happen on windows – and there doesn’t seem to be any documentation on how to fix this.
Thankfully, you can fix this problem by upgrading your RubyGems install using
gem update --system
I then installed Capistrano with no probs!
![]()
May 22, 2007 at 8:19 am
Thanks a lot for this post! I don’t think I would have figured it out all by myself. Thanks again!
May 22, 2007 at 9:53 am
Hey thanks a lot for that info deud! I was having trouble installing capistrano with instantrails for quite a while and this was the exact problem!
May 22, 2007 at 1:45 pm
Thank you. I never would have figured that out on my own. I was about to /wrists
May 23, 2007 at 1:58 am
[...] Thnx to don’t repeat yourself. [...]
May 27, 2007 at 6:28 pm
Thanks for this useful advice. Being a noob/intermediate RoR developer that error would have had me stymied for some time. However, with your help it only caused about a 2 minute delay
June 16, 2007 at 9:13 pm
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 tells you to, DON’T DO:
gem install -s http://gems.rubyonrails.com capistrano
September 7, 2007 at 5:47 pm
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.
May 18, 2008 at 7:01 pm
Thanks! I was hitting my head to the keyboard trying to figure out what the problem is because my gem was working just fine!
I posted on my blog with reference to yours if you don’t mind. I figure there must be more rubyforge project developers trying to figure this out.