running pod set up gives me “bad interpreter: No such file or directory”

前端 未结 14 2210
野性不改
野性不改 2020-12-13 02:53

recently tried to do pod setup and i get this:

-bash: /usr/local/bin/pod: /usr/local/opt/ruby/bin/ruby: bad interpreter: No such file or directo         


        
相关标签:
14条回答
  • 2020-12-13 03:37

    The "rubyist approved" way of doing this is to install a ruby version manager (rbenv) and install cocoapods through that. Messing with sudo and your rubygems is going to lead to tears.

    0 讨论(0)
  • 2020-12-13 03:39

    for MACOS X Catalina

    Tried most of the answers but none worked. If the above doesn't work try Opening Xcode preferences > Locations > selecting Command Line Tools to Xcode. Then install cocoapods

    sudo gem install -n /usr/local/bin cocoapods
    
    0 讨论(0)
  • 2020-12-13 03:40

    After upgrading from OS X Mojave to OS X Catalina I received this message when running pod init or pod --version: -bash: /Users/mangolassi/.gem/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory

    I don't like the idea of sudo gem install cocoapods so I have my .cocoapods folder in my user directory and I've modified my .bash_profile to point to it. The error I received was because the version 2.3 was hard coded in this file: /Users/eric/.gem/bin/pod and Catalina came with 2.6.

    It's possible that using sudo install would overwrite this file successfully, and probably does, but I wanted to keep my original setup.

    I was able to to just modify the first shebang line of the file /Users/eric/.gem/bin/pod to have a path with 2.6 instead of 2.3 and it worked. The entire change was changing the '3' to a '6' in my chase as the version was still '2'.

    0 讨论(0)
  • 2020-12-13 03:44

    On my mac this solved the problem:

    brew uninstall cocoapods
    
    brew install cocoapods
    
    0 讨论(0)
  • 2020-12-13 03:48

    In my case nothing of the above worked. I had ruby 2.3.0 installed and I had to downgrade to 2.0.0:

    gem update --system 2.0.0

    0 讨论(0)
  • 2020-12-13 03:56
    brew link --overwrite cocoapods
    

    This line saved my day.

    0 讨论(0)
提交回复
热议问题