ERROR: Error installing json:The 'json' native gem requires installed build tools.

简介: ERROR:  Error installing json:The 'json' native gem requires installed build tools.C:\ruby\blog>gem install json -v '1.

ERROR:  Error installing json:The 'json' native gem requires installed build tools.

C:\ruby\blog>gem install json -v '1.8.3'
ERROR:  Error installing json:The 'json' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'


在 windows下搭建Ruby Rails Web开发环境 时遇到这个问题,

 发生这个错误的原因是没有安装DevKit

DevKit

加上devkit之后,你的ruby中便具有了一个mingw32的本地编译环境,而且这个本地编译环境是自动调用的。只有在你要安装的gem需要本地编译时,才会调用devkit。 

http://rubyinstaller.org/add-ons/devkit

下载DevKit

http://rubyinstaller.org/downloads

安装DevKit

1、运行,解压到一个目录,例如:C:\DevKit

2、打开命令行,切换到这个目录;

3、执行命令:ruby dk.rb init

4、修改config.yml文件

[plain]  view plain copy
  1. # This configuration file contains the absolute path locations of all  
  2. # installed Rubies to be enhanced to work with the DevKit. This config  
  3. # file is generated by the 'ruby dk.rb init' step and may be modified  
  4. # before running the 'ruby dk.rb install' step. To include any installed  
  5. # Rubies that were not automagically discovered, simply add a line below  
  6. # the triple hyphens with the absolute path to the Ruby root directory.  
  7. #  
  8. # Example:  
  9. #  
  10. # ---  
  11. - C:\Ruby22-x64  
  12. # - C:/ruby192dev  
  13. #  
  14. ---  
[plain]  view plain copy
  1. C:\Ruby22-x64 是我的Ruby安装目录  

5、执行命令:ruby dk.rb install

[plain]  view plain copy
  1. C:\DevKit>ruby dk.rb install  
  2. [INFO] Updating conve

安装完DevKit之后,再执行命令安装JSON包:gem install json -v '1.8.3'

安装过程中可能会出现以下问题:

C:\ruby\blog>gem install json -v '1.8.3'
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    Errno::ECONNABORTED: An established connection was aborted by the software i
n your host machine. - SSL_connect (https://api.rubygems.org/quick/Marshal.4.8/json-1.8.3.gemspec.rz)
这可能是由于网络的原因,多试几次就好了。

https://github.com/oneclick/rubyinstaller/wiki/Development-Kit

目录
相关文章
|
JSON 边缘计算 数据格式
KubeEdge安装加入边缘节点报错: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal number into
KubeEdge安装加入边缘节点报错: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal number into
599 0
|
JSON 移动开发 应用服务中间件
调用Feign接口报错:JSON parse error:Illegal character ((CTRL-CHAR, code 31))
调用Feign接口报错:JSON parse error:Illegal character ((CTRL-CHAR, code 31))
3666 0
调用Feign接口报错:JSON parse error:Illegal character ((CTRL-CHAR, code 31))
|
JSON 数据格式
解决POSTMAN传参报错,JSON parse error: Cannot deserialize instance of `java.util.ArrayList` out of START_OB
解决POSTMAN传参报错,JSON parse error: Cannot deserialize instance of `java.util.ArrayList` out of START_OB
解决POSTMAN传参报错,JSON parse error: Cannot deserialize instance of `java.util.ArrayList` out of START_OB
|
11月前
|
JSON 前端开发 JavaScript
JSON parse error: Cannot deserialize value of type `java.lang.Integer` from Boolean value
这篇文章讨论了前端Vue应用向后端Spring Boot服务传输数据时发生的类型不匹配问题,即后端期望接收的字段类型为`int`,而前端实际传输的类型为`Boolean`,导致无法反序列化的问题,并提供了问题的诊断和解决方案。
JSON parse error: Cannot deserialize value of type `java.lang.Integer` from Boolean value
|
11月前
|
JavaScript
NodeJs——Parsing error: Cannot read file '.../tsconfig.json'.eslint
NodeJs——Parsing error: Cannot read file '.../tsconfig.json'.eslint
124 0
|
JSON Java 数据格式
JSON parse error: Unexpected character (‘t‘ (code 116)): was expecting double-quote to start field n
JSON parse error: Unexpected character (‘t‘ (code 116)): was expecting double-quote to start field n
|
JSON 资源调度 运维
vue vite启动项目报错ERROR: Unexpected “\x88“ in JSON 原因
vue vite启动项目报错ERROR: Unexpected “\x88“ in JSON 原因
819 0
vue vite启动项目报错ERROR: Unexpected “\x88“ in JSON 原因
|
JSON 数据格式
“JSON parse error: Unexpected character (‘1‘ (code 49))的解决方式
“JSON parse error: Unexpected character (‘1‘ (code 49))的解决方式
|
JavaScript
【Vue Error】Virtual script not found, may missing <script lang=“ts“> “allowJs“: true / jsconfig.json
【Vue Error】Virtual script not found, may missing <script lang=“ts“> “allowJs“: true / jsconfig.json
|
资源调度
error This module isn‘t specified in a package.json file.
error This module isn‘t specified in a package.json file.