Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 在windows 7上安装精简版时出现的问题_Ruby_Rubygems_Gem_Gemspecs - Fatal编程技术网

Ruby 在windows 7上安装精简版时出现的问题

Ruby 在windows 7上安装精简版时出现的问题,ruby,rubygems,gem,gemspecs,Ruby,Rubygems,Gem,Gemspecs,我对ruby是新手。我正在尝试安装ruby gem thin。它显示安装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

我对ruby是新手。我正在尝试安装ruby gem thin。它显示安装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>
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安装精简版
暂时增强包含DevKit的路径。。。
构建本机扩展。这可能需要一段时间。。。
错误:安装精简版时出错:
错误:无法生成gem本机扩展。
C:/Ruby200/bin/ruby.exe extconf.rb
正在检查-lc…***中的main()extconf.rb失败***
由于某些原因无法创建Makefile,可能缺少必要的
库和/或标题。有关详细信息,请查看mkmf.log文件。你可以
需要配置选项。
提供的配置选项:
--使用opt dir
--不带opt dir
--选择包含
--不带opt include=${opt dir}/include
--使用opt lib
--不带opt lib=${opt dir}/lib
--用make prog
--没有make prog
--srcdir=。
--库尔迪尔
--ruby=C:/Ruby200/bin/ruby
--with-thin_parser-dir
--不带-thin_parser-dir
--with-thin_解析器-include
--不带-thin_parser-include=${thin_parser-dir}/include
--with-thin_parser-lib
--不带-thin_parser-lib=${thin_parser-dir}/
--与克里布
--没有clib
C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:430:在“try_-do”中:编译器未能生成可执行文件。(运行时错误)
您必须首先安装开发工具。
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'
从C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:891:in'block in checking_'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:336:in'block(2个级别)in推迟'
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 delay'
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'delay'
来自C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:890:in'checking_'
从C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:941:in'have_library'
来自extconf.rb:4:in`'
Gem文件将保持安装在C:/Ruby200/lib/ruby/gems/2.0.0/gems/thin-1.6.0中以供检查。
结果记录到C:/Ruby200/lib/ruby/gems/2.0.0/gems/thin-1.6.0/ext/thin\u parser/gem\u make.out
C:\Users\name\Desktop>

非常感谢您的帮助。谢谢。

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

我卸载并删除了所有ruby内容,然后重新启动了机器。从这里下载了Ruby 2.0和Devkit

安装了ruby和devkit。使用此链接中给出的说明安装devkit


cd to ruby文件夹和已安装的rails,thin gem

我得到的错误可能与您指出的错误不同。但不管怎样,我尝试了那些建议。