(x86_64 上的 macOS 14.4.1,使用 ruby-build 20240501)ruby 2.7.7

问题描述 投票:0回答:1

我有一个 macbook pro M3 芯片,我正在尝试安装 Ruby 2.7.7,但不断遇到此错误:

构建失败(x86_64 上的 macOS 14.4.1,使用 ruby-build 20240501)

我已经这样做了 3 天,所以任何帮助将不胜感激:)

这是完整的构建日志:

`==> Installing ruby-2.7.7...
-> ./configure "--prefix=$HOME/.rbenv/versions/2.7.7" --enable-shared --with-gmp-dir=/usr/local/opt/gmp --with-ext=openssl,psych,+ --with-openssl-dir=/usr/local/opt/[email protected] --with-readline-dir=/usr/local/opt/readline --with-libyaml-dir=/usr/local/opt/libyaml --with-zlib-dir=/usr/local/opt/zlib
checking for ruby... /usr/bin/ruby
tool/config.guess already exists
tool/config.sub already exists
checking build system type... x86_64-apple-darwin23.4.0
checking host system type... x86_64-apple-darwin23.4.0
checking target system type... x86_64-apple-darwin23.4.0
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether clang accepts -g... yes
checking for clang option to enable C11 features... none needed
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for wchar.h... yes
checking for minix/config.h... no
checking for vfork.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking how to run the C preprocessor... clang -E
checking for clang++... clang++
checking whether the compiler supports GNU C++... yes
checking whether clang++ accepts -g... yes
checking for clang++ option to enable C++11 features... none needed
checking if minimum required OS X version is supported... yes
checking whether the compiler supports GNU C++... (cached) yes
checking whether clang++ accepts -g... (cached) yes
checking for clang++ option to enable C++11 features... (cached) none needed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking whether clang needs -traditional... no
checking for ld... ld
checking whether the linker is GNU ld... no
checking whether clang -E accepts -o... yes
checking for clang... /usr/bin/clang
checking for real target cpu... x86_64
checking for clang-ranlib... (cached) :
checking for clang-ar... (cached) libtool -static
checking for libtool -static flags... (cached) -no_warning_for_no_symbols -o
checking for as... as
checking for objdump... objdump
checking for objcopy... no
checking for gobjcopy... no
checking for clang-nm... no
checking for nm... nm
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for a race-free mkdir -p...  -d
use 'mkdir -p' as MKDIR_P
checking for dtrace... dtrace
checking for dot... no
checking for doxygen... no
checking for pkg-config... pkg-config
checking for cd using physical directory... cd -P
checking whether CFLAGS is valid... yes
checking whether LDFLAGS is valid... no
configure: error: something wrong with LDFLAGS="-L/opt/homebrew/opt/[email protected]/lib"
external command failed with status 1`

有人可以帮忙吗?

rbenv安装2.7.7

export LDFLAGS="-L/opt/homebrew/opt/[email protected]/lib" export CPPFLAGS="-I/opt/homebrew/opt/[email protected]/include" export PKG_CONFIG_PATH="/opt/homebrew/opt/[email protected]/lib/pkgconfig"

ruby-on-rails ruby
1个回答
0
投票

尝试:

RUBY_CONFIGURE_OPTS="--with-arch=arm64" rbenv install 2.7.7

© www.soinside.com 2019 - 2024. All rights reserved.