windows ruby​​安装jsduck错误

时间:2016-04-11 19:15:03

标签: ruby windows rubygems rdiscount jsduck

我正在尝试在ruby gem上安装jsduck,但是我收到了错误。

我已经下载了Ruby 2.3.0(x64)。

我还下载了适用于x64的DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe。

我安装了ruby 2.3.0(x64)。然后我将devkit提取到“C:/ ruby​​devkit”

我在“C:/ ruby​​devkit”文件夹中运行了以下命令:

  

$ ruby​​ dk.rb init

  

$ ruby​​ dk.rb install

到目前为止,一切都很好。我通过

成功安装了sass
  

$ gem install sass

然而,当我尝试

  

$ gem install jsduck

  

$ gem install rdiscount --platform = ruby​​

我遇到了以下错误:

$ gem install jsduck
        ERROR:  Error installing jsduck:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rdiscount-2.1.8/ext
C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20160411-6020-6ayo32.rb extconf.rb
checking for random()... no
checking for srandom()... no
checking for rand()... yes
checking for srand()... yes
checking size of unsigned long... 4
checking size of unsigned int... failed
checking size of unsigned short... 2
no int with size 2
*** 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:/Ruby23-x64/bin/$(RUBY_BASE_NAME)
        --with-rdiscount-dir
        --without-rdiscount-dir
        --with-rdiscount-include
        --without-rdiscount-include=${rdiscount-dir}/include
        --with-rdiscount-lib
        --without-rdiscount-lib=${rdiscount-dir}/lib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/rdiscount-2.1.8/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rdiscount-2.1.8 for inspection.
Results logged to C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/rdiscount-2.1.8/gem_make.out
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...

以下是我当前的版本:

Windows 8.1 64位

$ gem -v

2.5.1

$ ruby -v

ruby​​ 2.3.0p0(2015-12-25修订版53290)[x64-mingw32]

2 个答案:

答案 0 :(得分:1)

您是否尝试过使用precompiled windows binary?

你真的遇到了为Ruby编译二进制扩展的问题。特别是rdiscount依赖项无法编译 - 您可能会从rdiscount开发人员那里获得更好的帮助。

答案 1 :(得分:0)

RDiscount肯定适用于Windows上的Ruby 2.2.2(因为它涵盖了CI)和Linux上的Ruby 2.3.0(因为CI也涵盖了这一点)。

但RDiscount + Ruby 2.3.0 + Windows还没有经过测试。

看看你是否可以在Windows机器上使用Ruby 2.2.2成功构建。