Gem :: installerror:'json'本机gem需要安装的构建工具.请更新我们的PATH以包括构建工具 [英] Gem::installerror: the 'json' native gem requires installed build tools. Please update our PATH to include build tools
问题描述
我使用Railsinstaller来安装rails,但仍然收到此错误消息.基于与此有关的其他问题,Railsinstaller似乎应该包含devkit,并且应该不会出现此问题.
I used Railsinstaller to install rails, but I still get this error message. Based on what other questions regarding this, it seems that Railsinstaller should include devkit and this problem shouldn't happen.
我做错了什么?
顺便说一句,这是我将gemfile更改为在生产中包含'pg'的时候(当然,正在开发和测试sqlite),然后尝试运行bundle install-不生产.
By the way, this was when I changed the gemfile to include 'pg' under production (and of course, put sqlite under development and test) and then trying to run bundle install --without production.
提前感谢您的帮助!
推荐答案
如果您使用的是Windows,则可以在Rubyinstaller的文档中找到有关安装DevKit的详细说明:
If you are on Windows, then detailed instructions on installing DevKit can be found here in docs of Rubyinstaller:
https://github.com/oneclick/rubyinstaller/wiki/development-kit
按照这些说明进行操作后,便可以构建本机扩展.
After following these instructions native extensions will be able to build.
UPD :但奇怪的是,据其网站显示,Windows的Railsinstaller似乎已包含DevKit.可能您只需要执行该指令中的步骤4,即可确保已设置PATH.
UPD: but strange, seems like Railsinstaller for Windows already includes DevKit, according to its website. Probably you only need to do step 4 from that instruction to ensure that PATH is set.
如果我弄错了,并且您使用的是Mac,那么此答案应该会对您有所帮助.
If I'm mistaken and you are on Mac, then this answer should help you.
如果您使用的是Linux,则可能应该只从软件包管理器中安装了build-essential
.
If you were on Linux, you should probably only have installed build-essential
from your package manager.
这篇关于Gem :: installerror:'json'本机gem需要安装的构建工具.请更新我们的PATH以包括构建工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!