安装JSON gem的本机扩展错误(Native extension error installing JSON gem)

编程入门 行业动态 更新时间:2024-10-28 16:27:45
安装JSON gem的本机扩展错误(Native extension error installing JSON gem)

我已经设置了Brightbox Ruby 2.1.0 apt包,遇到了安装json包的本机编译错误。

$ sudo gem install json -v '1.8.1' Fetching: json-1.8.1.gem (100%) Building native extensions. This could take a while... ERROR: Error installing json: ERROR: Failed to build gem native extension. /usr/bin/ruby2.1 extconf.rb mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h extconf failed, exit code 1

我已经安装了ruby2.0-dev如下所述,但它将标题放在一个不同的文件夹中(/usr/include/ruby-2.0.0/ruby,并将它们复制到/ usr / lib / ruby​​ / include didn'帮助)。 知道如何安装这个宝石吗?

I've set up the Brightbox Ruby 2.1.0 apt package and encountering a native compilation error installing json package.

$ sudo gem install json -v '1.8.1' Fetching: json-1.8.1.gem (100%) Building native extensions. This could take a while... ERROR: Error installing json: ERROR: Failed to build gem native extension. /usr/bin/ruby2.1 extconf.rb mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h extconf failed, exit code 1

I've installed ruby2.0-dev as mentioned here, but it puts the headers in a different folder (/usr/include/ruby-2.0.0/ruby, and copying them to /usr/lib/ruby/include didn't help). Any idea how to install this gem?

最满意答案

我想你需要安装ruby2.1-dev软件包,而不是ruby2.0-dev,如果你使用的是Ruby 2.1。 我没有使用过Brightbox软件包,所以我只是猜测我很害怕。

I imagine you'll need to install the ruby2.1-dev package, rather than ruby2.0-dev, if you're using Ruby 2.1. I've not used the Brightbox packages though, so I'm only guessing I'm afraid.

更多推荐

本文发布于:2023-07-21 09:24:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1208949.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:本机   错误   gem   JSON   installing

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!