本文介绍了找不到macOS Mojave'ruby/config.h'文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在macOS Mojave(10.14.1)上用ruby支持(--enable-rubyinterp)构建vim(8.1.0509)时出现错误:

When I try to build vim(8.1.0509) with ruby support(--enable-rubyinterp) on macOS Mojave(10.14.1) I get error:

In file included from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby.h:33:
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby/ruby.h:24:10: fatal error:
      'ruby/config.h' file not found
#include "ruby/config.h"

我已经安装了Xcode 10.1.

I have installed Xcode 10.1.

xcode-select -p
/Applications/Xcode.app/Contents/Developer

谢谢

P.S.查看我对问题的回答,它解释了为什么我的问题与Xcode的问题不同

P.S.See my answer on my question It explains why my problem is different from the problem with Xcode

推荐答案

macOS Catalina

问题再次出现在Catalina中,但我无法在Developer SDK中找到此软件包.在找到更好的解决方案之前,我可以使用rubyenv解决此问题: https://github.com/orta/cocoapods-keys/issues/198#issuecomment-510909030

brew install rbenv ruby-build
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
rbenv install 2.6.3
rbenv global 2.6.3

莫哈韦及以上

此答案对我有帮助: https://stackoverflow.com/a/53194299/2105993

xcode-select --install
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

这篇关于找不到macOS Mojave'ruby/config.h'文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 23:56