'Failed to build gem native extension' on Windows 7 (The system cannot find the path specified)

蹲街弑〆低调 提交于 2019-11-29 01:15:43

So this isn't the best answer in the world, but I seem to have stumbled on a solution. If I set the verbose flag, everything works fine:

gem install json --platform=ruby --verbose

There's a log here: http://gist.github.com/dannysmith/8055495

That makes no sense - it'd be great if someone could explain why this seems to have fixed the error. Perhaps this is a bug in devkit?

Try running command prompt in admin mode. After like 7-10 hours I figured this out...

I have gem json installed with versions 1.8.1 but I was not able to solve this issue for json 1.6.1 using

gem install json --platform=ruby --verbose

So, I tried from here https://github.com/oneclick/rubyinstaller/issues/184

gem update --system 2.0.3

And after that

gem install json -v 1.6.1 --platform=ruby --verbose

It solve issue specific to json 1.6.1 for Win 7(64 bit) machine

codeslapper

Install the 32 bit version on Windows...

ver
windows 6.1.76011

64 bit gave error message about makefile and headers. Tried all other suggestions including those on rubyinstaller about COMSPEC and registry, adding gcc to path, and others. Some gems would install but git_fame and json would not as needed to compile.

Edit: It looks like git_fame uses mimer_plus. mimer_plus assumes gnu tools (unix tools). Looks like you need to install mingw first. That was not clearly indicated on the rubyinstaller page.

I had the same problem. I used powershell to check my path

ps> $s = $env:path

ps> $s.split("{;}")

sure enough my the ruby mingw was not in the path. I had the ruby\bin in the path but the mingw\bin was under a different folder. I went into my environment path and added it and my install worked.

Mosab Sasi

Make sure that the ruby version you installed (32 or 64 bit) matches the DevKit version. They both have to be 32 or 64, which was the issue I was having. May not be the exact issue here, but thought I'd throw that out there. Here's a post worth checking out:

Rails on windows - install issue

How I fixed it:

  1. Downloaded the latest ruby installer from https://rubyinstaller.org/downloads/
  2. Ran the installer, following the prompts to install dependencies.
  3. Restarted my computer.
  4. Added the ruby/bin directory to my PATH.
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!