[英]Ruby 2.2.1 is failing on install on mac
我有一个使用 ruby 2.2.1 构建的旧应用程序,我知道它已经过了 EOL,但我需要让应用程序运行,以便升级它。 我正在使用 rbenv 安装,但是安装时出现此错误。
Downloading openssl-1.0.2u.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16
Installing openssl-1.0.2u...
Installed openssl-1.0.2u to /Users/arthurveal/.rbenv/versions/2.2.10
Downloading ruby-2.2.10.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.10.tar.bz2
Installing ruby-2.2.10...
WARNING: ruby-2.2.10 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.
ruby-build: using readline from homebrew
BUILD FAILED (macOS 12.5 using ruby-build 20220726)
Inspect or clean up the working tree at /var/folders/c_/vydvf3y11v10dzyyp87nqrw40000gn/T/ruby-build.20220813181950.74610.xtMp6B
Results logged to /var/folders/c_/vydvf3y11v10dzyyp87nqrw40000gn/T/ruby-build.20220813181950.74610.log
Last 10 log lines:
rb_ivar_set(enumerator, rb_intern("slicewhen_pred"), pred);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1475:51: note: expanded from macro 'rb_intern'
__extension__ (CONST_ID_CACHE((ID), (str))) : \
^
28 warnings generated.
6 warnings generated.
6 warnings generated.
52 warnings generated.
20 warnings generated.
这是完整的错误日志。 我正在寻找允许此 ruby 版本运行的选项。
完整日志中的违规错误似乎是
encoding.c:825:2: error: implicit declaration of function 'rb_str_change_terminator_length' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
rb_str_change_terminator_length(obj, oldtermlen, termlen);
这似乎类似于https://github.com/rbenv/ruby-build/discussions/1854和https://github.com/rbenv/ruby-build/issues/1489中讨论的内容。
在这种情况下,这可能会有所帮助:
CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.2.1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.