找不到 macOS Mojave 'ruby/config.h' 文件 [英] macOS Mojave 'ruby/config.h' file not found

查看:33
本文介绍了找不到 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

谢谢

推荐答案

macOS Catalina

问题再次出现在 Catalina 中,我无法在 Developer SDK 中发现此包.在找到更好的解决方案之前,我能够使用 ruby​​env 解决此问题: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' 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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