Issue with Ruby gem install

2019-01-28 03:29发布

I am trying to install json on windows as follows, but its not working. Please help me with possible resoultion for the same.

C:\Ruby193\bin>gem install --local json-1.8.1.gem
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing json-1.8.1.gem:
        ERROR: Failed to build gem native extension.

    C:/Ruby193/bin/ruby.exe -r ./siteconf20140725-4216-11o740j.rb extconf.rb
creating Makefile

make  clean
Makefile:165: *** target pattern contains no `%'.  Stop.

make
Makefile:165: *** target pattern contains no `%'.  Stop.

make failed, exit code 2

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/extensions/x86-mingw32/1.9.1/json-1.8.1/gem_make.out

1条回答
戒情不戒烟
2楼-- · 2019-01-28 04:19

RubyGems 2.4.1 will not build native extensions in Ruby version 1.9.3 and earlier on Windows.

You will need to downgrade RubyGems to 1.8.29. To do this run the following command:

gem update --system 1.8.29

Check gem version:

gem -v
1.8.29

Now try your command again:

gem install --local json-1.8.1.gem

ref: https://groups.google.com/forum/#!topic/rubyinstaller/k19SeJijpKU/discussion

查看更多
登录 后发表回答