简体   繁体   English

无法在Windows中使用Cygwin安装Mechanize(错误:无法生成gem本机扩展。)

[英]Unable to install Mechanize using Cygwin in Windows ( ERROR: Failed to build gem native extension.)

I have been unsuccessful to install Mechanize My current ruby version 2.0.0 我无法安装Mechanize我当前的ruby版本2.0.0

This is what the error I get 这是我得到的错误

$ gem install mechanize
Building native extensions.  This could take a while...
ERROR:  Error installing mechanize:
        ERROR: Failed to build gem native extension.

    /usr/bin/ruby.exe extconf.rb
checking for main() in -lstdc++... *** 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=/usr/bin/ruby
        --with-stdc++lib
        --without-stdc++lib
/usr/share/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from /usr/share/ruby/2.0.0/mkmf.rb:519:in `try_link0'
        from /usr/share/ruby/2.0.0/mkmf.rb:534:in `try_link'
        from /usr/share/ruby/2.0.0/mkmf.rb:720:in `try_func'
        from /usr/share/ruby/2.0.0/mkmf.rb:950:in `block in have_library'
        from /usr/share/ruby/2.0.0/mkmf.rb:895:in `block in checking_for'
        from /usr/share/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone'
        from /usr/share/ruby/2.0.0/mkmf.rb:310:in `open'
        from /usr/share/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
        from /usr/share/ruby/2.0.0/mkmf.rb:310:in `open'
        from /usr/share/ruby/2.0.0/mkmf.rb:336:in `postpone'
        from /usr/share/ruby/2.0.0/mkmf.rb:894:in `checking_for'
        from /usr/share/ruby/2.0.0/mkmf.rb:945:in `have_library'
        from extconf.rb:2:in `<main>'


Gem files will remain installed in /home/Dennis/.gem/ruby/gems/unf_ext-0.0.6 for inspection.
Results logged to /home/Dennis/.gem/ruby/gems/unf_ext-0.0.6/ext/unf_ext/gem_make.out

I have tried this solution but is not working for me. 我已经尝试过此解决方案,但不适用于我。 I still receiving this similiar error. 我仍然收到此类似错误。

I also have nokogiri installed. 我也安装了nokogiri。 I wonder what is the problem here... 我想知道这里是什么问题...

To build the native extensions, you need the development kit installed. 要构建本机扩展,您需要安装开发套件。

Go to the Ruby Installer download page , download the DEVELOPMENT KIT according to your Ruby and system version, install the kit to an appropriate directory and then reinstall the gem. 转到Ruby Installer下载页面 ,根据您的Ruby和系统版本下载开发套件 ,将工具包安装到适当的目录,然后重新安装gem。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ruby install rails with Error ---Failed to build gem native extension.(Windows平台) - ruby install rails with Error ---Failed to build gem native extension.(Windows platform) 安装gem给出“无法构建gem原生扩展”。 - Install gem gives “Failed to build gem native extension.” 尝试在Mac OSX上安装ruby gem时出现错误:“无法构建gem本机扩展。” - Trying to install a ruby gem on Mac OSX gives me an error: “Failed to build gem native extension.” 捆绑安装:错误:无法构建gem原生扩展。 nio4r宝石 - Bundle install: ERROR: Failed to build gem native extension. nio4r gem 错误:未能 &gt; 构建 gem 原生扩展。 - 无法安装水龙头宝石 - ERROR: Failed to > build gem native extension. - Can't install taps gem nokogiri gem - 错误:无法构建 gem 本机扩展。 - nokogiri gem - ERROR: Failed to build gem native extension. Mountain Lion,无法在轨道上安装ruby [错误:无法构建gem本机扩展。 - Mountain Lion, failed to install ruby on rails [ERROR: Failed to build gem native extension.] 错误:安装json时出错:错误:无法构建gem本机扩展。 Windows 10 - ERROR: Error installing json: ERROR: Failed to build gem native extension. Windows 10 错误:无法生成gem本机扩展。 -无法安装断点和奇点 - ERROR: Failed to build gem native extension. - can't install breakpoint and singularity 错误:无法生成gem本机扩展。 尝试安装滑轨时 - ERROR: Failed to build gem native extension. when trying to install rails
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM