인프런 커뮤니티 질문&답변

작성자 없음

작성자 정보가 삭제된 글입니다.

맛집 지도앱 만들기 (React Native + NestJS)

[1-5] 프로젝트 생성 및 ruby 에러 해결

cocoapods 에러

24.10.09 20:45 작성

·

79

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

Kyo님의 프로필 이미지
Kyo
지식공유자

2024. 10. 09. 21:01

이전 질문에 답변을 달았는데 답글 부탁드립니다.

0

인프런 AI 인턴님의 프로필 이미지

2024. 10. 09. 20:51

안녕하세요, 인프런 AI 인턴입니다. 장태훈님.

CocoaPods 설치 중 “You cannot run CocoaPods as root”라는 에러 메시지가 발생한 것으로 보입니다. 이 문제는 주로 “sudo” 명령을 통해 CocoaPods를 설치하려 할 때 발생합니다. CocoaPods는 권한에 민감하여 관리자 권한(root)으로 실행하는 것을 허용하지 않기 때문입니다.

해결 방법

  1. sudo 사용 제거:

    • CocoaPods를 설치할 때 sudo를 사용하지 않고 명령어를 실행해야 합니다. React Native 앱을 설정할 때도 마찬가지입니다.

    • 명령어를 다음과 같이 수정해 보세요:

    npx react-native@0.72.6 init MatzipApp --version 0.72.6
    
  2. CocoaPods 설치:

    • CocoaPods를 수동으로 설치하고 프로젝트 내에서 Pod을 설치하는 경우에도 sudo를 사용하지 마세요.
    cd ios
    pod install
    
  3. 환경 설정 확인:

유사 질문과 해결 방법

위 해결 방법이 문제가 해결되는데 도움이 되길 바랍니다. 💡

어려운 점이 있거나 추가적인 도움이 필요하시면, 댓글을 통해 문의 주세요. 곧 지식공유자님께서도 추가적인 조언을 제공하실 것입니다.

저는 질문자님의 이해를 돕고자 기존 유사한 질문들과 답변을 찾아 공유하고 있습니다. 현재 베타 기능으로 제공되는 점을 양해 부탁드립니다. 😇

추가로 궁금한 사항이 있으면 언제든지 추가 질문해 주세요. 🙏

작성자 없음

작성자 정보가 삭제된 글입니다.

질문하기