Môi trường
- MacBook Pro M1 Max
- macOS 13.1 (Ventura)
- rbenv 1.2.0-50-g593f820
Vấn đề
Trong khi cài đặt Ruby 3.2.0 thì xuất hiện lỗi sau:
zsh
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Inspect or clean up the working tree at /var/folders/49/nz02t3_136xgn4jlw6z9r1q40000gn/T/ruby-build.20221229163135.84880.33u6aF
Results logged to /var/folders/49/nz02t3_136xgn4jlw6z9r1q40000gn/T/ruby-build.20221229163135.84880.log
Last 10 log lines:
ERROR: Ruby install aborted due to missing extensions
Configure options used:
--prefix=/Users/yuto/.anyenv/envs/rbenv/versions/3.2.0
--enable-shared
--with-readline-dir=/opt/homebrew/opt/readline
--with-gmp-dir=/opt/homebrew/opt/gmp
--with-openssl-dir=/usr/local/opt/[email protected]
CC=clang
LDFLAGS=-L/Users/yuto/.anyenv/envs/rbenv/versions/3.2.0/lib -L/opt/homebrew/opt/imagemagick@6/lib
CPPFLAGS=-I/Users/yuto/.anyenv/envs/rbenv/versions/3.2.0/include -I/opt/homebrew/opt/imagemagick@6/include
Sau khi đọc log để tìm lỗi thì mình phát hiện lỗi như sau:
zsh
Copy
1
The Ruby openssl extension was not compiled.
Do đó mình nghĩ lỗi phát sinh liên quan đến openssl
Cách khắc phục
Cài đặt lại openssl, readline, libyaml
Sau đó mình đã cài đặt thành công Ruby 3.2.0 bằng lệnh sau:
zsh
Copy
1
2
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix [email protected])"
rbenv install 3.2.0
