본문 바로가기

개발노트/MAC

m1 맥에서 오래된 루비 버전 설치 (with asdf)

Intel Mac 에서 M1 Mac 으로 마이그레이션 한 후, rbenv 를 통해 설치해뒀었던 ruby 가 정상적으로 작동하지 않아서, rbenv 를 깔끔하게 지우고, asdf 를 통해 ruby 를 설치하던 중 겪었던 이슈들이 있어, 예전 버전의 루비 설치를 workaround 를 통해 설치 성공한 것에 대한 기록

 

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

brew install asdf

wget https://raw.githubusercontent.com/rbenv/homebrew-tap/e472b7861b49cc082d1db0f66f265368da107589/Formula/openssl%401.0.rb
mv openssl%401.0.rb openssl@1.0.rb
brew install openssl@1.0.rb

# ~/.zshrc 수정
```
export PATH=/Users/hanbyul.lee/.asdf/shims:/opt/homebrew/bin:/opt/homebrew/opt/openssl@1.0/bin:$PATH
. /opt/homebrew/opt/asdf/libexec/asdf.sh

# For Old ruby versions
# https://medium.com/@3minus1/installing-old-ruby-versions-on-apple-m1-step-by-step-guide-501bb893c843
export LDFLAGS="-L/opt/homebrew/opt/openssl@1.0/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.0/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@1.0/lib/pkgconfig"
```

RUBY_CFLAGS="-Wno-error=implicit-function-declaration" RUBY_CONFIGURE_OPTS="--with-openssl-dir=/opt/homebrew/opt/openssl@1.0" asdf install ruby 2.3.3

 

m1 맥에서 ruby 2.3.3 설치 성공

 

참고

https://github.com/rbenv/ruby-build/issues/1691

 

Installation issues with Arm Mac (M1 Chip) · Issue #1691 · rbenv/ruby-build

Hey there! I am trying to install Ruby 2.7.2 on my new Apple Silicon Mac but am running into some issues, which I think might be related to ruby-build, but not I am not 100%. I have setup an alias ...

github.com

https://medium.com/@3minus1/installing-old-ruby-versions-on-apple-m1-step-by-step-guide-501bb893c843

 

Installing old Ruby versions on Apple M1 — Step by Step guide

I recently made the switch to Apple’s stunning new M1 Macbook Pro. Naturally, I git cloned all my projects. I came across a Rails 4…

medium.com

 

https://blog.dizy.dev/rails/2019/11/12/ruby-2-4-openssl-dependency.html  (갓동근님 블로그)

 

Ruby 2.4 미만 버전 설치시 openssl 의존성 문제 발생시

The Ruby openssl extension was not compiled.ERROR: Ruby install aborted due to missing extensions

blog.dizy.dev

 

반응형