问题
I'm trying to install Thin on Windows (ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]) but get an error message:
C:>gem install thin Building native extensions. This could take a while... ERROR: Error installing thin: ERROR: Failed to build gem native extension.
C:/rails/ruby/bin/ruby.exe extconf.rb checking for main() in c.lib... no creating Makefile
nmake
Microsoft (R) Program Maintenance Utility Version 1.50 Copyright (c) Microsoft Corp 1988-94. All rights reserved.
cl -nologo -I. -I. -IC:/rails/ruby/lib/ruby/1.8/i386-mswin32
-I. -MD -Zi -O2b2xg- -G6 -c -Tcparser.c 'cl' is not recognized as an internal or external command, operable program or batch file. NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code '0x1' Stop.
Gem files will remain installed in C:/rails/ruby/lib/ruby/gems/1.8/gems/thin-1.2.5 for inspection. Results logged to C:/rails/ruby/lib/ruby/gems/1.8/gems/thin-1.2.5/ext/thin_parser/gem_make.out
Google doesn't seem to help me here. Someone knows what is going on?
Thanks
回答1:
Thin needs to compile a C extension used by it. While it seems you have nmake
, seems that you don't have the complete Visual C++ 6.0 required to build it (the missing cl
is the C compiler).
I would recommend you use the build of Ruby based on MinGW, called RubyInstaller, which is the successor of One-Click Installer.
Thin provides pre-compiled binaries for that Ruby version. Also, adding the Development Kit as documented in some Tutorials, you should be able to compile other gems that lack binaries for Windows.
You will find download details and more information in the RubyInstaller website
Also, if you have further questions, please read the FAQ section of the wiki.
Hope that helps.
来源:https://stackoverflow.com/questions/2100213/problems-installing-thin-on-windows