I hit this problem after installing the "gem install rugged" on Windows using DevKit.
At the time I investigated the underlying problem and reported it, and I think artherschreiber committed a fix to the rugged repo on GitHub. I can't remember the details, and the fix might have been to libgit2 with rugged pulling in the libgit2 fix.
Unfortunately I don't think the released gem has been updated, so it doesn't pick up this fix.
At the time, I think I found that using a 32-bit Ruby, installing MSys / MinGW, and running "gem install rugged" from an MSys bash prompt did give a working version of rugged.