解决failed to build gem native extension on windows 7

安装好Ruby(1.9.3)之后,安装Rails,却报错了:

The system cannot find the path specified.
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
The system cannot find the path specified.
ERROR:  Error installing json:
    ERROR: Failed to build gem native extension.

    C:/Ruby193/bin/ruby.exe extconf.rb
creating Makefile


Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.8.1 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.8.1/ext/json/ext/generator/gem_make.out

解决办法:将RubyGems更新到2.3.0(之前的是2.4)

gem update --system 2.3.0

最后安装Rails:

gem install rails --no-ri --no-rdoc

安装成功。
这里写图片描述

你可能感兴趣的:(Ruby)