# Problem with gems, Windows, C extension

**URL:** <https://rubytalk.org/t/problem-with-gems-windows-c-extension/28594>\
**Category:** ruby-talk\
**Created:** [1 July 2006 01:32 UTC](https://rubytalk.org/t/problem-with-gems-windows-c-extension/28594 "2006-07-01T01:32:53Z")\
**Posts on this page:** 1\
**Page:** 1

<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:** [1 July 2006 01:32 UTC](https://rubytalk.org/t/problem-with-gems-windows-c-extension/28594/1 "2006-07-01T01:32:53Z")

</div>

Hi all,

Ruby 1.8.4 (one click)  
gems 0.9.0

I've got a C extension that I'm trying to install via gems on my Windows box  
called 'net-proto'. I can build and install the gem locally with no  
problem. However, when I try to install it remotely I get this error:

C:\ruby\src\>gem install net-proto  
Building native extensions. This could take a while...  
\*\*\* extconf.rb failed \*\*\*  
Could not create Makefile due to some reason, probably lack of  
necessary libraries and/or headers. Check the mkmf.log file for more  
details. You may need configuration options.

Provided configuration options:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--with-opt-dir  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--without-opt-dir  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--with-opt-include  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--without-opt-include=${opt-dir}/include  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--with-opt-lib  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--without-opt-lib=${opt-dir}/lib  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--with-make-prog  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--srcdir=.  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--curdir  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--ruby=c:/ruby/bin/ruby

ERROR: While executing gem ... (RuntimeError)  
&nbsp;&nbsp;&nbsp;&nbsp;ERROR: Failed to build gem native extension.  
Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/net-  
proto-1.0.1 for inspection.

I definitely have cl in my %PATH% so I'm not sure why it's not picking it  
up:

C:\\>cl -v  
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86  
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

There is no mkmf.log and the gem\_make.out file is empty. Below is the  
gemspec I used to build the gem currently on RubyForge:

require "rubygems"

summary = "The net-proto package provides the getprotobyname(), "  
summary += "getprotobynumber() and the getprotoent() methods for Ruby."

spec = Gem::Specification.new do |gem|  
&nbsp;&nbsp;&nbsp;[gem.name](http://gem.name) = "net-proto"  
&nbsp;&nbsp;&nbsp;gem.version = "1.0.1"  
&nbsp;&nbsp;&nbsp;gem.author = "Daniel J. Berger"  
&nbsp;&nbsp;&nbsp;gem.email = "djberg96@gmail.com"  
&nbsp;&nbsp;&nbsp;gem.homepage = "[http://www.rubyforge.org/projects/sysutils](http://www.rubyforge.org/projects/sysutils)"  
&nbsp;&nbsp;&nbsp;gem.platform = Gem::Platform::RUBY  
&nbsp;&nbsp;&nbsp;gem.summary = summary  
&nbsp;&nbsp;&nbsp;gem.description = summary  
&nbsp;&nbsp;&nbsp;gem.test\_file = "test/tc\_netproto.rb"  
&nbsp;&nbsp;&nbsp;gem.has\_rdoc = true  
&nbsp;&nbsp;&nbsp;gem.extra\_rdoc\_files = ["CHANGES","README"]  
&nbsp;&nbsp;&nbsp;gem.rubyforge\_project = "sysutils"  
&nbsp;&nbsp;&nbsp;files = Dir["doc/\*"] + Dir["test/\*"] + Dir["[A-Z]\*"]  
&nbsp;&nbsp;&nbsp;files.delete\_if{ |item| item.include?("CVS") }  
&nbsp;&nbsp;&nbsp;gem.files = files  
end

if $0 == \_\_FILE\_\_  
&nbsp;&nbsp;&nbsp;spec.required\_ruby\_version = '\>= 1.8.0'  
&nbsp;&nbsp;&nbsp;spec.extensions = ["extconf.rb"]

&nbsp;&nbsp;&nbsp;case RUBY\_PLATFORM  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when /win32|windows|mingw|cygwin/i  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file = 'lib/net/windows.c'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when /linux/i  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file = 'lib/net/linux.c'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when /sunos|solaris/i  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file = 'lib/net/sunos.c'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file = 'lib/net/generic.c'  
&nbsp;&nbsp;&nbsp;end

&nbsp;&nbsp;&nbsp;spec.files += ['lib/version.h', file]

&nbsp;&nbsp;&nbsp;Gem.manage\_gems  
&nbsp;&nbsp;&nbsp;Gem::Builder.new(spec).build  
end

Any ideas?

Thanks,

Dan
