我在一个要在Rails 4.2.10中进行工作的项目中进行捆绑安装时遇到了麻烦。捆绑时,我会收到下一个错误:
在安装ffi(1.9.25)时发生错误,并且Bundler无法继续。
捆绑之前,请确保HttpContext.Current.User.Identity.Name
成功。
gem install ffi -v '1.9.25'
当我运行gem In Gemfile:
s3_direct_upload was resolved to 0.1.6, which depends on
sass-rails was resolved to 5.0.7, which depends on
sass was resolved to 3.6.0, which depends on
sass-listen was resolved to 4.0.0, which depends on
rb-inotify was resolved to 0.9.10, which depends on
ffi
时也会发生错误:
install ffi -v '1.9.25'
我一直在尝试许多在线解决方案,但无法解决此问题。 似乎问题出在我的系统上,因为我是团队的新手,而其他开发人员也没有帮助,因为他们没有这种问题。
答案 0 :(得分:0)
根据libffi自述文件,只有GCC是在macOS上经过测试的编译器。您正在使用的Clang不支持命令行选项-print-multi-os-directory
。
您需要修补libffi才能使用Clang,或使用GCC。
答案 1 :(得分:0)
您的错误如下Configuring libffi
clang: error: unsupported option '-print-multi-os-directory'
clang: error: no input files
,因为Clang(您正在使用的C编译器)不支持选项'-print-multi-os-directory'
。
您是否可以通过执行以下命令来检查X-Code命令行工具是否已正确安装? xcode-select --install
您还介意尝试brew install automake autoconf libtool libffi
安装必需的依赖项吗?
答案 2 :(得分:0)
我能够使用以下命令成功安装ffi:
LDFLAGS="-L/usr/local/opt/libffi/lib" PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig" gem install ffi -v '1.9.25'
在某些日本板上找到