问题
I'm having problems getting thin working on my Windows 7 machine (I've already installed eventmachine v0.8.1):
>
gem install thin --ignore-dependencies
checking for main() in -lc... no
creating Makefilemake
'make' is not recognized as an internal or external command, operable program or batch file.
Are there not meant to be precompiled binaries available for thin?
回答1:
Apparently, there aren't any pre-built binaries.
You will need a C compiler installed. If you installed Ruby via the RubyInstaller, that is going to be really easy, if you used the One-Click Installer, it's goint to be a PITA.
See also: problems installing thin on Windows, which contains an answer by the RubyInstaller and One-Click Installer maintainer.
回答2:
There actually are pre-built binaries for particular versions of Thin but you need to know which ones. To get the latest pre-built win32 version do the following:
- Go to the RubyGems Thin page
- Look under the "Versions" section for a version that has "x86-mswin32" to the right of it. (As of today versions 1.2.11, 1.2.10, etc all have win32 binaries)
- Run the following following "gem install" command with the version of Thin included with the "-v" flag:
gem install thin -v 1.2.11
Here are the results from my installation:
c:\>gem install thin -v 1.2.11 Successfully installed thin-1.2.11-x86-mswin32 1 gem installed Installing ri documentation for thin-1.2.11-x86-mswin32... Updating ri class cache with 3611 classes... Installing RDoc documentation for thin-1.2.11-x86-mswin32...
回答3:
I've worked around the lack of precompiled binaries by installing a compiler:
- I iInstalled MinGW to C:\MinGW (see here for installation instructions)
- I then installed MSYS to C:\msys\1.0
- I then added c:\MinGW\bin and C:\msys\1.0\bin to my %PATH%
- Finally I ran
gem install thin
and amazingly it all worked!
I hope this helps out some other poor Windows ruby developer! :-)
回答4:
A binary for thin is in fact available (and apparently one has been since ver 1.2.2).
However, I couldn't install thin on Windows 7 with Ruby 1.9.2 (p290) because of its dependency on EventMachine.
Running gem install thin --ignore-dependencies
was what was needed to get thin itself installed.
Just wanted to add this note for some other ruby on Windows user.
来源:https://stackoverflow.com/questions/2139196/problems-installing-thin-on-windows-7-x86