[英]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.