일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 파이썬
- 개발 영어실력
- 개발 공식문서 읽기
- 실무PT
- 데이터스키마
- 자료구조
- 웹서버
- 코딩강의
- 개발공부
- 스키마모델
- 컴공과개념정리
- 개발실무
- postgredb
- 코멘토
- 개발자되기
- 알고리즘
- golang
- 개발 공식문서
- 개발자공통지식
- 유데미
- Go언어
- 리액트
- jsx
- 자바
- tableplus
- 데이터베이스
- HTTP
- 코멘토실무PT
- Go언어실무
- 개발공식문서 어려움
- Today
- Total
웹개발일지
Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew) 본문
Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)
hee_log 2023. 2. 24. 16:50
안드로이드 스튜디오에서 아이폰 애뮬레이터를 돌리겨고하니 코코아 패드설치가 안되어있었고 install 하려니 루비 설치가 필요했다.
그런데 brew, rbenv 로 설치가 안되고 이런 오류가 났다.
To follow progress, use 'tail -f /var/folders/3z/49pl5tk95gg7yndz9r47gy4h0000gn/T/ruby-build.20230224144819.22927.log' or pass --verbose
Downloading openssl-3.0.8.tar.gz...
->
https://dqw8nmjcqpjn7.cloudfront.net/6c13d2bf38fdf31eac3ce2a347073673f5d63263398f1f69d0df4a41253e4b3e
Installing openssl-3.0.8...
Installed openssl-3.0.8 to /Users/shinheejin/.rbenv/versions/3.2.1
Downloading ruby-3.2.1.tar.gz...
->
https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.1.tar.gz
Installing ruby-3.2.1...
ruby-build: using readline from homebrew
BUILD FAILED (macOS 13.1 using ruby-build 20230222)
Inspect or clean up the working tree at /var/folders/3z/49pl5tk95gg7yndz9r47gy4h0000gn/T/ruby-build.20230224144819.22927.UbohsY
Results logged to /var/folders/3z/49pl5tk95gg7yndz9r47gy4h0000gn/T/ruby-build.20230224144819.22927.log
Last 10 log lines:
compiling ossl_x509ext.c
linking shared-object date_core.bundle
compiling ossl_x509name.c
compiling ossl_x509req.c
compiling ossl_x509revoked.c
compiling ossl_x509store.c
installing default openssl libraries
linking shared-object openssl.bundle
linking shared-object ripper.bundle
make: *** [build-ext] Error 2
루비 공식문서에 달린 이슈들을 쭉 확인하며 임시로 환경변수 설정도 줘보고 이래 저래 버전을 바꿔가며 재설치를 해봤지만 적용되지 않았고 무엇보다 현재 mac 버전 관련 해결방법이 없어 더이상 해볼 수 없었다.
그러다 chatgpt 로 해결을 했다! 공식문서에서 CPPFLAGS로 명령을 주라는 답변이 몇 있었는데 chatgpt는 먼저 이렇게 변수 설정해주는 것을 알려주었다.
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export LDFLAGS="-L/usr/local/opt/openssl/lib"
문제는 openssl 이 제대로 설치되지 않는 점이었다.
1. openssl 설치 중 오류 Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)!
-> 이 과정에서 난 오류 때문에 사실 전에도 해결을 못했다. 다음과 같은 오류인데 m1 사용하면서 예전부터 많이 발생하던 오류다.
알고보니 homebrew 가 x84(openssl이 필요로함) 에서 돌지않아 관련 패키지를 설치하지 못한다는 것이었다.
The error message you're seeing indicates that you're trying to install OpenSSL on an M1 Mac using the x86 version of Homebrew. This won't work because Homebrew is running under Rosetta 2, which is the translation layer that allows x86 software to run on M1 Macs.
해결책
1. Arm 버전을 homebrew에 넣어주기
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2. Arm 버전 homebrew에서 openssl 설치
arch -arm64 brew install openssl
3. 환경변수에 관련 경로 저장
export PATH="/opt/homebrew/bin:$PATH"
'오류해결' 카테고리의 다른 글
command not found : [mac m1] 터미널 환경변수 설정 관련 문제 해결 (0) | 2023.03.28 |
---|---|
dart null 체크 (0) | 2023.03.06 |
The argument type 'String' can't be assigned to the parameter type 'Uri'. (0) | 2023.03.06 |