在windows7上安装瘦肉精的问题[英] Problems in installing thin on windows 7

本文是小编为大家收集整理的关于在windows7上安装瘦肉精的问题的处理方法,想解了在windows7上安装瘦肉精的问题的问题怎么解决?在windows7上安装瘦肉精的问题问题的解决办法?那么可以参考本文帮助大家快速定位并解决问题。

问题描述

我是红宝石新手.我正在尝试安装一个 ruby​​ gem 薄.它在安装 gem 时显示错误.我用谷歌搜索了错误,但找不到解决我问题的链接.

错误是:

    C:\Users\name\Desktop>ruby -v
    ruby 2.0.0p247 (2013-06-27) [i386-mingw32]

    C:\Users\name\Desktop>gem -v
    2.0.3

    C:\Users\name\Desktop>gem install thin
    Temporarily enhancing PATH to include DevKit...
    Building native extensions.  This could take a while...
    ERROR:  Error installing thin:
            ERROR: Failed to build gem native extension.

        C:/Ruby200/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:/Ruby200/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}/
            --with-clib
            --without-clib
    C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:430:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
    You have to install development tools first.
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:515:in `try_link0'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:530:in `try_link'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:716:in `try_func'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:946:in `block in have_library'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:891:in `block in checking_for'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:336:in `block (2 levels) in postpone'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:306:in `open'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:336:in `block in postpone'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:306:in `open'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:332:in `postpone'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:890:in `checking_for'
            from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:941:in `have_library'
            from extconf.rb:4:in `<main>'


    Gem files will remain installed in C:/Ruby200/lib/ruby/gems/2.0.0/gems/thin-1.6.0 for inspection.
    Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/gems/thin-1.6.0/ext/thin_parser/gem_make.out

    C:\Users\name\Desktop>

非常感谢任何帮助.谢谢.

推荐答案

我按照以下步骤解决了问题.发布此答案,因为它可能对其他人有用.

我卸载并删除了所有 ruby​​ 的东西,然后重新启动了机器.从这里 http://rubyinstaller.org/downloads/ 下载了 Ruby 2.0 和 Devkit.

已安装 ruby​​ 和 devkit.使用此链接中给出的说明安装 devkit https://github.com/oneclick/rubyinstaller/wiki/开发工具包.

cd 到 ruby​​ 文件夹并安装 rails,thin gem

本文地址:https://www.itbaoku.cn/post/786674.html