Ruby不安装json -v 1.8.1作为bundle的一部分,错误:无法构建gem本地扩展 [英] Ruby not installing json -v 1.8.1 as part of bundle, ERROR: Failed to build gem native extension

查看:487
本文介绍了Ruby不安装json -v 1.8.1作为bundle的一部分,错误:无法构建gem本地扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试安装使用作为捆绑包的一部分并使用sudo,但每次都收到相同的错误消息。我目前在 Ruby 2.0.0和Rails 4.1.8 。我不确定发生了什么事。下面的确切错误信息:


https://rubygems.org/ ..........

解决依赖关系...

使用rake 10.4.2使用i18n 0.6.11



Gem :: Ext :: BuildError:错误:无法构建gem本机扩展。

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r
./siteconf20141218-80226-brqexc.rb extconf.rb mkmf.rb找不到
标题
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h



extconf失败,退出代码1



Gem文件将保留安装在
/Library/Ruby/Gems/2.0.0/gems/json-1.8.1中进行检查。结果
记录到
/Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/json-1.8.1/gem_make.out
发生错误同时安装json(1.8.1),并且Bundler不能
继续。确保 gem install json -v'1.8.1'
捆绑之前成功。


任何建议的赞赏。

解决方案

我在Ubuntu上遇到类似的错误,做的是:

  sudo apt-get install ruby​​-dev 

对于Mac来说,下面的要点似乎值得仔细研究:安装mac for ruby​​ dev


I've tried installing using as part of the bundle and using sudo, but I get the same error message every time. I'm currently on Ruby 2.0.0 and Rails 4.1.8. I'm not sure what is going on. The exact error message below:

Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using rake 10.4.2 Using i18n 0.6.11

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20141218-80226-brqexc.rb extconf.rb mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/json-1.8.1 for inspection. Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/json-1.8.1/gem_make.out An error occurred while installing json (1.8.1), and Bundler cannot continue. Make sure that gem install json -v '1.8.1' succeeds before bundling.

Any advice appreciated.

解决方案

I've run into similar error on Ubuntu and all I needed to do was:

sudo apt-get install ruby-dev

For Mac, the following gist seems worth to have a look into: Setup mac for ruby dev

这篇关于Ruby不安装json -v 1.8.1作为bundle的一部分,错误:无法构建gem本地扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆