sudo gem install json遭遇如下的错误信息何解呢?
tinyfool
由 tinyfool
发布于 2014年06月11日
| 更新于 2014年06月12日
无人欣赏。
Mac OS X 10.10,安装有Xcode5 和 Xcode 6 beta,command line tools选的是Xcode 5的,我是Ruby初学者
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
creating Makefile
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
In file included from ./../fbuffer/fbuffer.h:5:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby.h:33:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/ruby.h:24:10: fatal error: 'ruby/config.h' file not found
#include "ruby/config.h"
^
1 error generated.
make: *** [generator.o] Error 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/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
共28条回复
楼长
·
liprais
回复于 2014年06月11日
xcode 6 command line tools 装了没?
3楼
·
5楼
·
xuan_lengyue
回复于 2014年06月11日
建议用 RVM 或者 rbenv,这两者安装 gem 都是无需 sudo 的,ruby 版本和 gemset 也比较好控制。
6楼
·
tinyfool
回复于 2014年06月11日
5楼 @xuan_lengyue RVM安装了,但是还是有点问题,我感觉是我机器上面有不同的ruby,然后混乱了
7楼
·
tinyfool
回复于 2014年06月11日
使用RVM安装发现了新的问题
Error running 'requirements_osx_brew_update_system ruby-2.1.2',
showing last 15 lines of /Users/tinyfool/.rvm/log/1402459044_ruby-2.1.2/update_system.log
https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.'
++ rvm_pretty_print stderr
++ case "${rvm_pretty_print_flag:=auto}" in
++ case "${TERM:-dumb}" in
++ case "1ドル" in
++ [[ -t 2 ]]
++ return 1
++ printf %b 'Failed to update Homebrew, follow instructions here:
https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.n'
Failed to update Homebrew, follow instructions here:
https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.
++ return 1
Requirements installation failed with status: 1.
8楼
·
tinyfool
回复于 2014年06月11日
但是brew update也报错,唉,简直就是俄罗斯套娃错误啊
brew update
/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined error: 0
9楼
·
liprais
回复于 2014年06月11日
搜到了这个 https://gist.github.com/chrisb/4d6a09c6cc1ca2e1b14e 目测是因为homebrew 还在用ruby 1.8而10.10上没有1.8导致的问题...总之还是要装xcode 6 command line tools
本帖有28个回复,因为您没有注册或者登录本站,所以只能看到本帖的10条回复。如果想看到全部回复,请注册或者登录本站。
相关新闻
- 你真的想要一个AI小 gadgets?(注意:gadget一词可以理解为"小工具"或"小玩意",此处根据上下文可能译为"设备"更合适。如果需要更加精准的翻译,请提供更多的上下文信息。如果没有更多信息,输出原文:Do you really want an AI gadget?) 由于要求只输出翻译结果且不添加任何注释,则直接翻译如下: 你真的想要一个AI小工具吗?
- 亿万富翁以色列·英格兰格正在出售英伟达和派拉蒙的股票,并大举买入一只历史上价格低廉、但潜在问题重重的人工智能(AI)股票 | 华尔街日报注:原文提到的Palantir应为The Motley Fool网站报道中的误植,通常提及的是另一家科技公司。鉴于此,原文可能指代有误或信息不准确,故保留英文名称Palantir以示明确。然而,根据上下文和通用理解,如果需要进一步具体化,则可能涉及其他特定的AI相关公司股票。