gpt4 book ai didi

ruby - RVM 安装 ruby​​ 2.6.4 失败,生成文件错误 : implicit declaration of function 'ffi_prep_closure' is invalid in C99

转载 作者:行者123 更新时间:2023-12-04 11:58:29 24 4
gpt4 key购买 nike

RVM rvm 1.29.12-下一个
M1 芯片上的 Mac OS Big Sur rvm install 2.6.4失败:

Error running '__rvm_make -j8',
please read /Users/jason/.rvm/log/1626110300_ruby-2.6.4/make.log

There has been an error while running make. Halting the installation.
生成文件错误是:
error: implicit declaration of function 'ffi_prep_closure' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = ffi_prep_closure(pcl, cif, callback, (void *)self);

最佳答案

这是由您的 shell 中未设置 RVM 的环境标志引起的。brew info libffi会告诉你你需要的变量:
要让编译器找到 libffi,您可能需要设置:
导出 LDFLAGS="-L/opt/homebrew/opt/libffi/lib"
导出 CPPFLAGS="-I/opt/homebrew/opt/libffi/include"
对于 pkg-config 查找 libffi,您可能需要设置:
export PKG_CONFIG_PATH="/opt/homebrew/opt/libffi/lib/pkgconfig"
对于 ZSH,编辑 ~/.zshenv并添加:

export LDFLAGS="-L/opt/homebrew/opt/libffi/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libffi/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/libffi/lib/pkgconfig"
关闭并重新打开您的终端窗口或 source ~/.zshrc加载您的更改
检查你的工作
% echo $LDFLAGS
-L/opt/homebrew/opt/libffi/lib
% echo $CPPFLAGS
-I/opt/homebrew/opt/libffi/include
% echo $PKG_CONFIG_PATH
/opt/homebrew/opt/libffi/lib/pkgconfig
(确认环境变量无误)
重新尝试安装您要安装的rvm版本。

关于ruby - RVM 安装 ruby​​ 2.6.4 失败,生成文件错误 : implicit declaration of function 'ffi_prep_closure' is invalid in C99,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68351594/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com