【发布时间】:2013-05-07 21:59:00
【问题描述】:
我似乎无法在 Windows 上安装 Thin gem。 一个非常相似的问题被问到here,但是在把所有的答案都捆绑起来之后它仍然不起作用。
追踪:
C:/Ruby193/bin/ruby.exe extconf.rb
checking for main() in -lc... *** 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
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby193/bin/ruby
--with-thin_parser-dir
--without-thin_parser-dir
--with-thin_parser-include
--without-thin_parser-include=${thin_parser-dir}/include
--with-thin_parser-lib
--without-thin_parser-lib=${thin_parser-dir}/lib
--with-clib
--without-clib
C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:461:in `try_link0'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:476:in `try_link'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:619:in `try_func'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:845:in `block in have_library'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:840:in `have_library'
from extconf.rb:4:in `<main>'
来自 RubyInstaller for Windows 的 DevKit 已安装。
时间机器已安装。
其他宝石也可以。
有没有人面临相同或类似的问题?
使用 Windows 7 Professional 和最新的 1.9 Ruby。
顺便说一句:
我还发现了this 问题。 cmets 参考上述问题,可能的解决方案是重新安装 Xcode。但是我没有使用 Xcode,也没有安装它。
【问题讨论】:
-
Xcode 是 OSX 的东西,不适用于 Win。您的问题是:它以某种方式找不到 DevKit 安装。所以你需要仔细找出原因。
-
感谢您的评论,我知道 Xcode 是用于 OSX 的。 DevKit 已安装并且似乎配置正确;配置文件包含 gems 的路径。