# Broken Gems on Windows (still)

**URL:** <https://rubytalk.org/t/broken-gems-on-windows-still/49776>\
**Category:** ruby-talk\
**Created:** [22 October 2008 13:38 UTC](https://rubytalk.org/t/broken-gems-on-windows-still/49776 "2008-10-22T13:38:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_T](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@John\_T](https://rubytalk.org/u/John_T)\
**Post date:** [22 October 2008 13:38 UTC](https://rubytalk.org/t/broken-gems-on-windows-still/49776/1 "2008-10-22T13:38:14Z")

</div>

(I realized I posted this originally on the Rails mailing list, when it  
probably should have been here... oops!)

Hello...

Is there any word on when the eventmachine 0.12.2 and sqlite3-ruby 1.2.4  
gems are going to be fixed to work when updating gems on a Windows (xp)  
system? Doing a 'gem update' will cause errors for both, which causes  
the rest of the updated to installed gems to not be updated. I've been  
using a workaround script that skips the errors and continues updating,  
but I'd be nice to get updated gems.

(I'm also seeing a strange thing with the webby gem - when doing a 'gem  
outdated', I see:

webby (0.9.3 \< 0.9.3)

and updating causes the "new" version to be installed, but gem outdated  
still gives that message.)

Here are the errors for sqlite3-ruby and eventmachine, for what it's  
worth...

eventmachine:

updating eventmachine...  
ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)  
&nbsp;&nbsp;&nbsp;&nbsp;ERROR: Failed to build gem native extension.

c:/ruby/bin/ruby.exe extconf.rb update eventmachine  
checking for windows.h... no

nmake  
'nmake' is not recognized as an internal or external command,  
operable program or batch file.

Gem files will remain installed in  
c:/ruby/lib/ruby/gems/1.8/gems/eventmachine-0  
.12.2 for inspection.  
Results logged to  
c:/ruby/lib/ruby/gems/1.8/gems/eventmachine-0.12.2/ext/gem\_mak  
e.out

sqlite3-ruby:

updating sqlite3-ruby...  
ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)  
&nbsp;&nbsp;&nbsp;&nbsp;ERROR: Failed to build gem native extension.

c:/ruby/bin/ruby.exe extconf.rb update sqlite3-ruby  
checking for fdatasync() in rt.lib... no  
checking for sqlite3.h... no

nmake  
'nmake' is not recognized as an internal or external command,  
operable program or batch file.

Gem files will remain installed in  
c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1  
.2.4 for inspection.  
Results logged to  
c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3\_  
api/gem\_make.out

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Daniel\_Berger2](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/daniel_berger2/32/2243_2.png) [@Daniel\_Berger2](https://rubytalk.org/u/Daniel_Berger2)\
**Post date:** [22 October 2008 15:15 UTC](https://rubytalk.org/t/broken-gems-on-windows-still/49776/2 "2008-10-22T15:15:16Z")

</div>

Hi,

\<snip\>

> eventmachine:
> 
> updating eventmachine...  
> ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)  
> ERROR: Failed to build gem native extension.
> 
> c:/ruby/bin/ruby.exe extconf.rb update eventmachine  
> checking for windows.h... no
> 
> nmake  
> 'nmake' is not recognized as an internal or external command,  
> operable program or batch file.

Looks like eventmachine is a C extension. You either don't have a  
compiler installed, or your shell's environment isn't setup right.  
Therefore, it fails.

Or did I miss the point of your question somehow?

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![John\_T](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@John\_T](https://rubytalk.org/u/John_T)\
**Post date:** [22 October 2008 17:08 UTC](https://rubytalk.org/t/broken-gems-on-windows-still/49776/3 "2008-10-22T17:08:33Z")

</div>

Daniel Berger wrote:

> Hi,
> 
> \<snip\>
> 
> > 'nmake' is not recognized as an internal or external command,  
> > operable program or batch file.
> 
> Looks like eventmachine is a C extension. You either don't have a  
> compiler installed, or your shell's environment isn't setup right.  
> Therefore, it fails.
> 
> Or did I miss the point of your question somehow?
> 
> Regards,
> 
> Dan

Whoops...forgot to mention.. I do have (various version) of Visual  
Studio loaded - VS 6, VS 2003, VS 2005, VS 2008. I've tried with each  
versions of VSVARS32.bat, which sets the env vars for the various  
environments.

This is the error, for eventmachine, after running the VSVARS32.bat:

ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)  
&nbsp;&nbsp;&nbsp;&nbsp;ERROR: Failed to build gem native extension.

c:/ruby/bin/ruby.exe extconf.rb update eventmachine  
checking for windows.h... yes  
checking for winsock.h... yes  
checking for main() in kernel32.lib... yes  
checking for main() in rpcrt4.lib... yes  
checking for main() in gdi32.lib... yes  
checking for main() in ssleay32.lib... no  
creating Makefile

nmake

Microsoft (R) Program Maintenance Utility Version 6.00.8168.0  
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cl -I. -I. -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I. -MD -Zi  
-O2b2xg- -G6  
-DHAVE\_WINDOWS\_H -DHAVE\_WINSOCK\_H -D OS\_WIN32 -D BUILD\_FOR\_RUBY -EHs  
-GR -D WI  
HOUT\_SSL -c -Tpbinder.cpp  
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for  
80x86  
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

binder.cpp  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cl -I. -I. -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I. -MD -Zi  
-O2b2xg- -G6  
-DHAVE\_WINDOWS\_H -DHAVE\_WINSOCK\_H -D OS\_WIN32 -D BUILD\_FOR\_RUBY -EHs  
-GR -D WI  
HOUT\_SSL -c -Tpcmain.cpp  
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for  
80x86  
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

cmain.cpp  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cl -I. -I. -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I. -MD -Zi  
-O2b2xg- -G6  
-DHAVE\_WINDOWS\_H -DHAVE\_WINSOCK\_H -D OS\_WIN32 -D BUILD\_FOR\_RUBY -EHs  
-GR -D WI  
HOUT\_SSL -c -Tpcplusplus.cpp  
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for  
80x86  
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

cplusplus.cpp  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cl -I. -I. -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I. -MD -Zi  
-O2b2xg- -G6  
-DHAVE\_WINDOWS\_H -DHAVE\_WINSOCK\_H -D OS\_WIN32 -D BUILD\_FOR\_RUBY -EHs  
-GR -D WI  
HOUT\_SSL -c -Tped.cpp  
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for  
80x86  
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

ed.cpp  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cl -I. -I. -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I. -MD -Zi  
-O2b2xg- -G6  
-DHAVE\_WINDOWS\_H -DHAVE\_WINSOCK\_H -D OS\_WIN32 -D BUILD\_FOR\_RUBY -EHs  
-GR -D WI  
HOUT\_SSL -c -Tpem.cpp  
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for  
80x86  
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

em.cpp  
em.cpp(1193) : error C2374: 'i' : redefinition; multiple initialization  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;em.cpp(1186) : see declaration of 'i'  
NMAKE : fatal error U1077: 'cl' : return code '0x2'  
Stop.

Gem files will remain installed in  
c:/ruby/lib/ruby/gems/1.8/gems/eventmachine-  
.12.2 for inspection.  
Results logged to  
c:/ruby/lib/ruby/gems/1.8/gems/eventmachine-0.12.2/ext/gem\_ma  
e.out

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Daniel\_Berger2](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/daniel_berger2/32/2243_2.png) [@Daniel\_Berger2](https://rubytalk.org/u/Daniel_Berger2)\
**Post date:** [22 October 2008 17:23 UTC](https://rubytalk.org/t/broken-gems-on-windows-still/49776/4 "2008-10-22T17:23:36Z")

</div>

Hm. I had to make one (seemingly unrelated) tweak to em.cpp to build  
eventmachine 0.12.2 with VC++ 8 on Windows XP Pro:

--- em.orig Wed Oct 22 11:13:48 2008  
+++ em.cpp Wed Oct 22 11:20:48 2008  
@@ -31,6 +31,9 @@  
#ifdef OS\_WIN32  
unsigned gTickCountTickover;  
unsigned gLastTickCount;  
+#ifndef EINTR  
+#define EINTR WSAEINTR  
+#endif  
#endif

After I made that change it seemed to build fine.

In any case, it's not a gem issue, but an issue with eventmachine. I  
noticed they aren't shipping a gem with a pre-built binary with the  
latest release, which would definitely be handy for the Windows users.

Regards,

Dan

> **···**
>
> On Oct 22, 11:08 am, "John T." \<joh...@charter.net\> wrote:
> 
> > Daniel Berger wrote:  
> > \> Hi,
> > 
> > \> \<snip\>
> > 
> > \>\> 'nmake' is not recognized as an internal or external command,  
> > \>\> operable program or batch file.
> > 
> > \> Looks like eventmachine is a C extension. You either don't have a  
> > \> compiler installed, or your shell's environment isn't setup right.  
> > \> Therefore, it fails.
> > 
> > \> Or did I miss the point of your question somehow?
> > 
> > \> Regards,
> > 
> > \> Dan
> > 
> > Whoops...forgot to mention.. I do have (various version) of Visual  
> > Studio loaded - VS 6, VS 2003, VS 2005, VS 2008. I've tried with each  
> > versions of VSVARS32.bat, which sets the env vars for the various  
> > environments.
> > 
> > This is the error, for eventmachine, after running the VSVARS32.bat:
> > 
> > ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)  
> > ERROR: Failed to build gem native extension.
> > 
> > c:/ruby/bin/ruby.exe extconf.rb update eventmachine  
> > checking for windows.h... yes  
> > checking for winsock.h... yes  
> > checking for main() in kernel32.lib... yes  
> > checking for main() in rpcrt4.lib... yes  
> > checking for main() in gdi32.lib... yes  
> > checking for main() in ssleay32.lib... no  
> > creating Makefile
> > 
> > nmake
> > 
> > Microsoft (R) Program Maintenance Utility Version 6.00.8168.0  
> > Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
> > 
> > ```
> > cl \-I\. \-I\. \-Ic:/ruby/lib/ruby/1\.8/i386\-mswin32 \-I\. \-MD \-Zi
> > 
> > ```
> > 
> > -O2b2xg- -G6  
> > -DHAVE\_WINDOWS\_H -DHAVE\_WINSOCK\_H -D OS\_WIN32 -D BUILD\_FOR\_RUBY -EHs  
> > -GR -D WI  
> > HOUT\_SSL -c -Tpbinder.cpp  
> > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for  
> > 80x86  
> > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > 
> > binder.cpp  
> > cl -I. -I. -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I. -MD -Zi  
> > -O2b2xg- -G6  
> > -DHAVE\_WINDOWS\_H -DHAVE\_WINSOCK\_H -D OS\_WIN32 -D BUILD\_FOR\_RUBY -EHs  
> > -GR -D WI  
> > HOUT\_SSL -c -Tpcmain.cpp  
> > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for  
> > 80x86  
> > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > 
> > cmain.cpp  
> > cl -I. -I. -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I. -MD -Zi  
> > -O2b2xg- -G6  
> > -DHAVE\_WINDOWS\_H -DHAVE\_WINSOCK\_H -D OS\_WIN32 -D BUILD\_FOR\_RUBY -EHs  
> > -GR -D WI  
> > HOUT\_SSL -c -Tpcplusplus.cpp  
> > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for  
> > 80x86  
> > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > 
> > cplusplus.cpp  
> > cl -I. -I. -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I. -MD -Zi  
> > -O2b2xg- -G6  
> > -DHAVE\_WINDOWS\_H -DHAVE\_WINSOCK\_H -D OS\_WIN32 -D BUILD\_FOR\_RUBY -EHs  
> > -GR -D WI  
> > HOUT\_SSL -c -Tped.cpp  
> > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for  
> > 80x86  
> > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > 
> > ed.cpp  
> > cl -I. -I. -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I. -MD -Zi  
> > -O2b2xg- -G6  
> > -DHAVE\_WINDOWS\_H -DHAVE\_WINSOCK\_H -D OS\_WIN32 -D BUILD\_FOR\_RUBY -EHs  
> > -GR -D WI  
> > HOUT\_SSL -c -Tpem.cpp  
> > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for  
> > 80x86  
> > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > 
> > em.cpp  
> > em.cpp(1193) : error C2374: 'i' : redefinition; multiple initialization  
> > em.cpp(1186) : see declaration of 'i'  
> > NMAKE : fatal error U1077: 'cl' : return code '0x2'  
> > Stop.
