gpt4 book ai didi

ruby - 在 Windows 上安装 RubyInstaller 和 DevKit 后无法安装 rdiscount gem

转载 作者:数据小太阳 更新时间:2023-10-29 08:00:39 30 4
gpt4 key购买 nike

我在尝试在我的 Windows 7 机器上设置 RoR 时遇到一些错误。我使用 RubyInstaller 和 DevKit 安装了 Ruby。在他们的指示中,它说执行 gem install rdiscount --platform=ruby 以确保它已正确安装。我收到以下错误:

C:\Windows\system32>cd ../../DevKit

C:\DevKit>gem install rdiscount --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing rdiscount:
ERROR: Failed to build gem native extension.

C:/Ruby200-x64/bin/ruby.exe extconf.rb
checking for random()... *** 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:/Ruby200-x64/bin/ruby
--with-rdiscount-dir
--without-rdiscount-dir
--with-rdiscount-include
--without-rdiscount-include=${rdiscount-dir}/include
--with-rdiscount-lib
--without-rdiscount-lib=${rdiscount-dir}/
C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:431:in `try_do': The compiler failed to ge
nerate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:516:in `try_link0'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:531:in `try_link'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:717:in `try_func'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:1001:in `block in have_func'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:892:in `block in checking_for
'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:337:in `block (2 levels) in p
ostpone'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:307:in `open'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:337:in `block in postpone'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:307:in `open'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:333:in `postpone'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:891:in `checking_for'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:1000:in `have_func'
from extconf.rb:5:in `<main>'


Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rdisc
ount-2.0.7.1 for inspection.
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rdiscount-2.0.7.1/ext/
gem_make.out

我试过了 this suggestion ,并删除了重复的 libiconv-2.dll 文件,但问题仍然存在。有什么建议吗?

最佳答案

此时,RDiscount 在 Windows 上损坏,请参阅 issue #74 at GitHub

如果您已经安装了 Ruby 和 DevKit,那么您可以安装其他 gem,例如 jsonRedCloth 来验证它是否正确编译:

gem install json --platform=ruby
gem install RedCloth --platform=ruby

希望对您有所帮助。

关于ruby - 在 Windows 上安装 RubyInstaller 和 DevKit 后无法安装 rdiscount gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15230814/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com