无法使用rubyinstaller安装rails 4.0。 *** extconf.rb失败***

时间:2013-06-28 20:03:05

标签: ruby ruby-on-rails-3.2 gem ruby-on-rails-4

我正在尝试使用ruby安装程序在rails(v4.0)上安装ruby。它给我这个错误。我是RoR的新手,一些网站告诉我安装devkit。我做到了。我跑 gem install thin

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

    C:/RubyRails/bin/ruby.exe extconf.rb
*** 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:/RubyRails/bin/ruby
        --with-atomic_reference-dir
        --without-atomic_reference-dir
        --with-atomic_reference-include
        --without-atomic_reference-include=${atomic_reference-dir}/include
        --with-atomic_reference-lib
        --without-atomic_reference-lib=${atomic_reference-dir}/
C:/RubyRails/lib/ruby/2.0.0/mkmf.rb:431:in `try_do': The compiler failed to gene
rate an executable file. (RuntimeError)
You have to install development tools first.
        from C:/RubyRails/lib/ruby/2.0.0/mkmf.rb:516:in `try_link0'
        from C:/RubyRails/lib/ruby/2.0.0/mkmf.rb:814:in `try_run'
        from extconf.rb:22:in `<main>'


Gem files will remain installed in C:/RubyRails/lib/ruby/gems/2.0.0/gems/atomic-
1.1.10 for inspection.
Results logged to C:/RubyRails/lib/ruby/gems/2.0.0/gems/atomic-1.1.10/ext/gem_ma
ke.out

提前感谢您的帮助

4 个答案:

答案 0 :(得分:3)

如果在Windows上需要安装Ruby DevKit,请从http://rubyinstaller.org/downloads/获取它(向下滚动一点)。

答案 1 :(得分:0)

同样的故事在这里删除ruby并安装:

  • Ruby 2.0.0-p247
  • 的devkit-mingw64-32-4.7.2-20130224-1151-sfx.exe
来自http://rubyinstaller.org/downloads/

解决了这个问题。

答案 2 :(得分:0)

尝试使用http://railsinstaller.org/中的railsinstaller 它会安装下面的

Ruby 1.9.3-p392
Rails 4
Bundler
Git
Sqlite
TinyTDS
SQL Server Support
DevKit

答案 3 :(得分:0)

当您尝试组合32位Ruby和64位DevKit时,也会发生同样的情况。 解决方案是使用相同位版本。

例如当前版本: rubyinstaller-2.0.0-P247-x64.exe程序 的devkit-mingw64-64-4.7.2-20130224-1432-sfx.exe