# Problem with gems, Windows, C extension

**URL:** <https://www.ruby-forum.com/t/problem-with-gems-windows-c-extension/96726>\
**Category:** Ruby\
**Created:** [July 1, 2006, 3:33am UTC](https://www.ruby-forum.com/t/problem-with-gems-windows-c-extension/96726 "2006-07-01T03:33:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [July 1, 2006, 3:33am UTC](https://www.ruby-forum.com/t/problem-with-gems-windows-c-extension/96726/1 "2006-07-01T03:33:33Z")

</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:  
–with-opt-dir  
–without-opt-dir  
–with-opt-include  
–without-opt-include=${opt-dir}/include  
–with-opt-lib  
–without-opt-lib=${opt-dir}/lib  
–with-make-prog  
–srcdir=.  
–curdir  
–ruby=c:/ruby/bin/ruby

ERROR: While executing gem … (RuntimeError)  
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|  
gem.name = “net-proto”  
gem.version = “1.0.1”  
gem.author = “Daniel J. Berger”  
gem.email = “removed\_email\_address@domain.invalid”  
gem.homepage = “[http://www.rubyforge.org/projects/sysutils](http://www.rubyforge.org/projects/sysutils)”  
gem.platform = Gem::Platform::RUBY  
gem.summary = summary  
gem.description = summary  
gem.test\_file = “test/tc\_netproto.rb”  
gem.has\_rdoc = true  
gem.extra\_rdoc\_files = [“CHANGES”,“README”]  
gem.rubyforge\_project = “sysutils”  
files = Dir[“doc/_"] + Dir["test/_”] + Dir[“[A-Z]\*”]  
files.delete\_if{ |item| item.include?(“CVS”) }  
gem.files = files  
end

if $0 == **FILE**  
spec.required\_ruby\_version = ‘\>= 1.8.0’  
spec.extensions = [“extconf.rb”]

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

spec.files += [‘lib/version.h’, file]

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

Any ideas?

Thanks,

Dan
