cocoapods 에러
349
작성자 없음
작성한 질문수 0
알려주신 방법대로 했는데 이번에는 아래와 같은 에러가 발생합니다 ㅠㅠ
gongmyeong@Huns-Pro documents % sudo npx react-native@0.72.6 init MatzipApp --version 0.72.6
Password:
###### ######
### #### #### ###
## ### ### ##
## #### ##
## #### ##
## ## ## ##
## ### ### ##
## ######################## ##
###### ### ### ######
### ## ## ## ## ###
### ## ### #### ### ## ###
## #### ######## #### ##
## ### ########## ### ##
## #### ######## #### ##
### ## ### #### ### ## ###
### ## ## ## ## ###
###### ### ### ######
## ######################## ##
## ### ### ##
## ## ## ##
## #### ##
## #### ##
## ### ### ##
### #### #### ###
###### ######
Welcome to React Native!
Learn once, write anywhere
✔ Downloading template
✔ Copying template
✔ Processing template
✔ Installing Ruby Gems
ℹ Installing Ruby Gems
✔ Installing CocoaPods
✖ Installing CocoaPods dependencies (this may take a few minutes)
error bundler: failed to load command: pod (/Users/gongmyeong/Documents/MatzipApp/vendor/bundle/ruby/2.7.0/bin/pod)
CLAide::Help: [!] You cannot run CocoaPods as root.
Usage:
$ pod COMMAND
CocoaPods, the Cocoa library package manager.
Commands:
+ cache Manipulate the CocoaPods cache
+ env Display pod environment
+ init Generate a Podfile for the current directory
+ install Install project dependencies according to versions from a
Podfile.lock
+ ipc Inter-process communication
+ lib Develop pods
+ list List pods
+ outdated Show outdated project dependencies
+ repo Manage spec-repositories
+ setup Set up the CocoaPods environment
+ spec Manage pod specs
+ update Update outdated project dependencies and create new Podfile.lock
Options:
--allow-root Allows CocoaPods to run as root
--silent Show nothing
--version Show the version of the tool
--verbose Show more debugging information
--no-ansi Show output without ANSI codes
--help Show help banner of specified command
/Users/gongmyeong/Documents/MatzipApp/vendor/bundle/ruby/2.7.0/gems/claide-1.1.0/lib/claide/command.rb:439:in `help!'
/Users/gongmyeong/Documents/MatzipApp/vendor/bundle/ruby/2.7.0/gems/cocoapods-1.15.2/lib/cocoapods/command.rb:102:in `ensure_not_root_or_allowed!'
/Users/gongmyeong/Documents/MatzipApp/vendor/bundle/ruby/2.7.0/gems/cocoapods-1.15.2/lib/cocoapods/command.rb:48:in `run'
/Users/gongmyeong/Documents/MatzipApp/vendor/bundle/ruby/2.7.0/gems/cocoapods-1.15.2/bin/pod:55:in `<top (required)>'
/Users/gongmyeong/Documents/MatzipApp/vendor/bundle/ruby/2.7.0/bin/pod:23:in `load'
/Users/gongmyeong/Documents/MatzipApp/vendor/bundle/ruby/2.7.0/bin/pod:23:in `<top (required)>'
✖ Installing CocoaPods dependencies (this may take a few minutes)
error Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/environment-setup?os=macos&platform=android and follow the React Native CLI QuickStart guide for macOS and iOS.
info Run CLI with --verbose flag for more details.
답변 2
0
안녕하세요, 인프런 AI 인턴입니다. 장태훈님.
CocoaPods 설치 중 “You cannot run CocoaPods as root”라는 에러 메시지가 발생한 것으로 보입니다. 이 문제는 주로 “sudo” 명령을 통해 CocoaPods를 설치하려 할 때 발생합니다. CocoaPods는 권한에 민감하여 관리자 권한(root)으로 실행하는 것을 허용하지 않기 때문입니다.
해결 방법
sudo 사용 제거:
CocoaPods를 설치할 때
sudo를 사용하지 않고 명령어를 실행해야 합니다. React Native 앱을 설정할 때도 마찬가지입니다.명령어를 다음과 같이 수정해 보세요:
npx react-native@0.72.6 init MatzipApp --version 0.72.6CocoaPods 설치:
- CocoaPods를 수동으로 설치하고 프로젝트 내에서 Pod을 설치하는 경우에도
sudo를 사용하지 마세요.
cd ios pod install- CocoaPods를 수동으로 설치하고 프로젝트 내에서 Pod을 설치하는 경우에도
환경 설정 확인:
- 제공된 링크(React Native CLI QuickStart guide for macOS and iOS)를 따라 macOS 및 iOS 개발 환경이 올바르게 설정되어 있는지도 확인해 보시기 바랍니다.
- 제공된 링크(React Native CLI QuickStart guide for macOS and iOS)를 따라 macOS 및 iOS 개발 환경이 올바르게 설정되어 있는지도 확인해 보시기 바랍니다.
유사 질문과 해결 방법
- CocoaPods 설치 시 ‘You cannot run CocoaPods as root’ 오류 해결: 루비나 권한 문제로 인해 주로 발생하는 CocoaPods 설치 문제에 대한 해결 방법입니다.
- 프로젝트 생성 시 npm start를 하고 a를 눌러 안드로이드 에뮬레이터를 키려면 오류가 납니다.: 오픈 소스 프로젝트 관련 문제 해결 방법입니다.
위 해결 방법이 문제가 해결되는데 도움이 되길 바랍니다. 💡
어려운 점이 있거나 추가적인 도움이 필요하시면, 댓글을 통해 문의 주세요. 곧 지식공유자님께서도 추가적인 조언을 제공하실 것입니다.
저는 질문자님의 이해를 돕고자 기존 유사한 질문들과 답변을 찾아 공유하고 있습니다. 현재 베타 기능으로 제공되는 점을 양해 부탁드립니다. 😇
추가로 궁금한 사항이 있으면 언제든지 추가 질문해 주세요. 🙏
react-native-screens 버전 호환 문제
2
153
1
안드로이드 실행 중 Drawer네비게이션과 MapView 성능 문제
0
103
2
해당 강의 부분은 실제 활용하기에 부족해 제가 해결한 방법입니다.
0
96
1
소스코드가 강의 순서랑 다른가요?
0
72
2
현재 Windows에서 VsCode로 작업 중인데 추후에 IOS도 가능하게 하려면
0
115
2
react-native-fast-image는 react 19 버전에서 설치가 안되나요?
0
209
2
SQL Shell의 역할이 무엇인가요?
0
91
1
혹시 해당 강의에서invalidateQueries를 사용한 이유가 있을까요?
0
79
2
빠르게 실행해보고싶습니다.
0
83
1
강의 수강 순서 관련
0
70
1
애뮬레이터 실행 방법
0
99
2
무료 Apple ID로 실기기 테스트 가능한가요?
0
90
2
ios 실기기 연결
0
70
2
npm run ios에러
0
74
1
10월 삭제 예정인 강의는 이유를 알 수 있을까요?
0
101
1
캘린더 개발 후에 navigation 에 대해서 궁금한 점이 있습니다.
0
51
1
안드로이드 위치 권한 이슈 2가지 문의
0
71
1
지도가 보이려면 음.. 작성해주신 스타일과 다르게
0
74
0
제대로 설치한거같은데 안드로이드랑 ios 둘다 앱실행이 안되는것같아요
0
83
3
강의 내용을 보면 전체적으로 function 함수 키워드를 사용하시는데
0
69
2
강의 3-9 에서 useGetRefreshToken 훅 안에 즉시 함수로 처리하는 이유가 궁금합니다!
0
82
2
사내에서 figma.com 업로드 안되나요?
0
96
1
AWS EC2 + RDS 설정
0
85
2
안드로이드 안켜집니다.
0
91
2





