M1macでrbenv 2.7.1 installしようとしたときに発生したError

### 環境
mac OS Monterey ver. 12.0.1
rbenv 1.2.0
Homebrew 3.3.7

### 実行したコマンド
備忘録として残しておく


```
$ rbenv install 2.7.1
```
### Error
```
Downloading openssl-1.1.1l.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
Installing openssl-1.1.1l...
Installed openssl-1.1.1l to /Users/kawabataharuki/.rbenv/versions/2.7.1

Downloading ruby-2.7.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.1.tar.bz2
Installing ruby-2.7.1...
ruby-build: using readline from homebrew

BUILD FAILED (macOS 12.0.1 using ruby-build 20211019)

Inspect or clean up the working tree at /var/folders/fk/j1ynkl3x4_nf_z0x5q_79f600000gn/T/ruby-build.20211210132726.25203.UPZtrh
Results logged to /var/folders/fk/j1ynkl3x4_nf_z0x5q_79f600000gn/T/ruby-build.20211210132726.25203.log

Last 10 log lines:
        imemo_type_ids[10] = rb_intern("imemo_parser_strterm");
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../.././include/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
1392 warnings generated.
linking shared-object objspace.bundle
422 warnings generated.
linking shared-object date_core.bundle
make: *** [build-ext] Error 2
```

### 実行したコマンド
```
$ arch -arm64 rbenv install 2.7.1
```
### Error
```
Downloading openssl-1.1.1l.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
Installing openssl-1.1.1l...
Installed openssl-1.1.1l to /Users/kawabataharuki/.rbenv/versions/2.7.1

Downloading ruby-2.7.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.1.tar.bz2
Installing ruby-2.7.1...
ruby-build: using readline from homebrew

BUILD FAILED (macOS 12.0.1 using ruby-build 20211203)

Inspect or clean up the working tree at /var/folders/fk/j1ynkl3x4_nf_z0x5q_79f600000gn/T/ruby-build.20211210141535.15027.drzWUT
Results logged to /var/folders/fk/j1ynkl3x4_nf_z0x5q_79f600000gn/T/ruby-build.20211210141535.15027.log

Last 10 log lines:
                                                       ^
compiling ../.././ext/psych/yaml/writer.c
2 warnings generated.
8 warnings generated.
4 warnings generated.
linking shared-object zlib.bundle
linking shared-object psych.bundle
422 warnings generated.
linking shared-object date_core.bundle
make: *** [build-ext] Error 2
```

### 実行したコマンド
```
RUBY_CFLAGS=-DUSE_FFI_CLOSURE_ALLOC arch -arm64 rbenv install 2.7.1
```
### 成功時

```
Downloading openssl-1.1.1l.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
Installing openssl-1.1.1l...
Installed openssl-1.1.1l to /Users/kawabataharuki/.rbenv/versions/2.7.1

Downloading ruby-2.7.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.1.tar.bz2
Installing ruby-2.7.1...
ruby-build: using readline from homebrew
Installed ruby-2.7.1 to /Users/kawabataharuki/.rbenv/versions/2.7.1
```

### 参考にしたもの
https://github.com/ffi/ffi/issues/869

https://ja.stackoverflow.com/questions/77921/m1mac%E3%81%A7rbenv-install-2-7-2%E3%82%92%E5%AE%9F%E8%A1%8C%E6%99%82-%E3%82%A8%E3%83%A9%E3%83%BC%E3%81%8C%E7%99%BA%E7%94%9F%E3%81%97%E3%81%A6%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%9B%E3%82%93