优胜美地升级破坏了ruby.h [英] Yosemite upgrade broke ruby.h

查看:150
本文介绍了优胜美地升级破坏了ruby.h的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从升级到优胜美地以来,我在尝试构建任何包含ruby.h的内容时都会遇到此错误:

Ever since upgrading to Yosemite, I get this error trying to build anything that includes ruby.h:

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[1]: *** [objects/if_ruby.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [first] Error 2

当然,/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/config.h确实丢失了.

$ ls -laF /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/
total 72
drwxr-xr-x  21 root  wheel    714 Jul 29 21:56 ./
drwxr-xr-x   5 root  wheel    170 Jul 29 21:56 ../
drwxr-xr-x   7 root  wheel    238 Jul 29 21:56 backward/
-rw-r--r--   2 root  wheel   3360 Sep 21 15:25 debug.h
-rw-r--r--   2 root  wheel   5553 Sep 21 15:25 defines.h
-rw-r--r--   2 root  wheel    881 Sep 21 15:25 digest.h
-rw-r--r--   2 root  wheel   7628 Sep 21 15:25 dl.h
-rw-r--r--   2 root  wheel  14123 Sep 21 15:25 encoding.h
-rw-r--r--   2 root  wheel  32904 Sep 21 15:25 intern.h
-rw-r--r--   2 root  wheel   5869 Sep 21 15:25 io.h
-rw-r--r--   2 root  wheel   4522 Sep 21 15:25 missing.h
-rw-r--r--   2 root  wheel  37617 Sep 21 15:25 oniguruma.h
-rw-r--r--   2 root  wheel   1502 Sep 21 15:25 re.h
-rw-r--r--   2 root  wheel    890 Sep 21 15:25 regex.h
-rw-r--r--   2 root  wheel  49734 Sep 21 15:25 ruby.h
-rw-r--r--   2 root  wheel   4651 Sep 21 15:25 st.h
-rw-r--r--   2 root  wheel    374 Sep 21 15:25 subst.h
-rw-r--r--   2 root  wheel   1102 Sep 21 15:25 thread.h
-rw-r--r--   2 root  wheel   2139 Sep 21 15:25 util.h
-rw-r--r--   2 root  wheel   1968 Sep 21 15:25 version.h
-rw-r--r--   2 root  wheel   1794 Sep 21 15:25 vm.h

安装过程中是否意外地添加了文件?优胜美地是否附带了破获的Ruby头文件集?

Did the install accidentally a file? Does Yosemite just ship with a busted Ruby header file set?

解决此问题的最佳方法是什么?我可以在其中解压缩源代码以获得正确的标题吗?

What's the best way to fix this? Can I just unpack the source code in there to get the right headers?

推荐答案

关于此的一个注释:升级到"OS X El Capitan"后,我遇到了这个问题.我通过运行'xcode-select --install'安装了命令行工具.之后,我的ruby构建环境再次开始工作.

One note on this: I ran into this problem after upgrading to "OS X El Capitan". I installed the command line tools by running 'xcode-select --install'. After that, my ruby build environment started working again.

这篇关于优胜美地升级破坏了ruby.h的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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