views:

307

answers:

2
+1  Q: 

Error Building Gem

I tried to install the following gem:

http://github.com/maxjustus/sinatra-authentication

on Windows 7 running Ruby 1.9 from the One-Click Installer.

I got the following error:

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Joel>gem install sinatra-authentication
Building native extensions.  This could take a while...
ERROR:  Error installing sinatra-authentication:
        ERROR: Failed to build gem native extension.

C:/Ruby19/bin/ruby.exe extconf.rb
creating Makefile

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


Gem files will remain installed in C:/Ruby19/lib/ruby/gems/1.9.1/gems/yajl-ruby-
0.7.5 for inspection.
Results logged to C:/Ruby19/lib/ruby/gems/1.9.1/gems/yajl-ruby-0.7.5/ext/gem_mak
e.out

I looked everywehere online, tried to install earlier versions, and attempted a manual install without success (it gave me a stack too deep error).

I suspect there are problems with the yajl-ruby gem (http://github.com/brianmario/yajl-ruby), a dependency? (I think)

The logs in gem_make.out show:

C:/Ruby19/bin/ruby.exe extconf.rb
creating Makefile

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

Do you have any idea as to how to solve this? Thanks!

A: 

It looks like the gem installation depends on the make program being installed, which you do not have. You can use GNU Make for Windows.

alunny
I actually installed that just after posting this, with no success.
Joel M.
Restarted my computer as well, and nope. Do I have to setup paths or something?
Joel M.
Fixed it using the env. variables.
Joel M.
I get another problem now. See below.
Joel M.
It's not just matter of not having `make`, he needs a whole C development environment for windows. If he installs the RubyInstaller Devkit he will get this.
banister
+2  A: 

To compile C extensions, you need to install the devkit that comes with RubyInstaller. You will find a link to download it here: http://rubyinstaller.org/download.html

banister
Also a windows developer exploring ruby. I'd just finished recreating the devkit when I found this post. I want those hours back. http://github.com/oneclick/rubyinstaller/wiki/Development-Kit
Precipitous