“pod init” giving error “-bash: pod: command not found”

前端 未结 6 1220
日久生厌
日久生厌 2021-02-05 04:40

I am trying to create a Podfile for my Xcode project for Firebase compatibility, but when I try to create it within the same file that my Xcode project is stored in, using my te

相关标签:
6条回答
  • 2021-02-05 04:45

    if the 1st command doesn't work, try the 2nd command

    sudo gem install cocoapods
    
    sudo gem install -n /usr/local/bin cocoapods
    

    In my case, the 2nd command worked

    0 讨论(0)
  • 2021-02-05 04:50

    Looks like you didn't install CocoaPods.

    To do that you install it through ruby gems, like this:

    sudo gem install cocoapods
    

    If you don't have admin privileges, try:

    gem install cocoapods --user-install
    
    0 讨论(0)
  • 2021-02-05 04:58

    Got this error today. Was able to resolve it by making sure I had ruby in my PATH.

    export PATH=/usr/bin/ruby:$PATH
    

    Then (as suggested by answers above) run

    sudo gem install cocoapods
    

    Or

    sudo gem install -n /usr/local/bin cocoapods
    
    0 讨论(0)
  • 2021-02-05 05:06

    I ran into this problem yesterday, I reckon others in my situation will be too. So I am running a mac OS siera on a virtual machine on my windows so I can use xcode. Firstly you will need to update your version of ruby, it has been answered here: https://stackoverflow.com/a/38194139/7451779.

    Once updated this just run: $ sudo gem install cocoapods

    After all this $ pod init should work

    0 讨论(0)
  • 2021-02-05 05:07

    Brew install

    $ brew install cocoapods      
    

    For me sudo gem install cocoapodsdid not work.
    When I tried $sudo gem install -n /usr/local/bin cocoapods it threw me weird error messages. But brew install was pretty neat.

    0 讨论(0)
  • 2021-02-05 05:11

    For OS Catalina (as of December 2019)

    gem install -n /usr/local/bin cocoapods
    
    0 讨论(0)
提交回复
热议问题