Can't get to work CocoaPods and Yosemite

后端 未结 6 1746
南笙
南笙 2020-12-19 05:24

I already tried this steps:

  1. Open Xcode 6 Open Preferences
  2. Click the Locations tab
  3. Change the Command Line Tools version to Xcode 6.0
相关标签:
6条回答
  • 2020-12-19 06:01

    The error 'require': cannot load such file indicates that you some missing or broken gem package. You can probably fix it by re-installing cocoapods:

    gem uninstall cocoapods # Follow by sudo if necessary
    gem install cocoapods --verbose # Follow by sudo if necessary
    

    And make sure that your xcodeproj is present:

    gem install xcodeproj --verbose # Follow by sudo if necessary
    

    If won't help, try to install it by using older Ruby:

    sudo ln -s /Library/Ruby/Gems/1.8/gems/rubygems-update-1.8.12/bin/gem /usr/bin/gem18
    sudo gem18 install cocoapods
    

    See:

    • Managing Rails Versions and Gems
    0 讨论(0)
  • 2020-12-19 06:02

    Many of this issues are because of system-wide ruby installation and it forces developers to use "sudo" all the time (well, how many times we did "sudo gem install cocoapods --pre"). I recently had the same issue trying to install a pre-released version of cocoapods (permissions were messed up). So here is a approached that worked for me.

    $ sudo gem uninstall xcodeproj 
    $ sudo gem uninstall cocoapods
    
    # Let's restore Apple's ruby installation, the following is for Yosemite that has 2.0 ruby by default 
    $ cd /System/Library/Frameworks/Ruby.framework/Versions
    $ sudo rm Current
    $ sudo ln -s 2.0 Current 
    $ brew install ruby
    

    (closing and opening terminal window sometimes help)

    $ which ruby
    

    should display /usr/local/bin/ruby (should point to "local" directory now, not to "/usr/bin", if this is not the case for you, make sure to modify path order)

    Now you should be able to install xcodeproj and cocoapods without using "sudo":

    $ gem install xcodeproj --pre
    $ gem install cocoapods --pre
    

    (I'm using pre-released version, just remove --pre if you want to use releases instead).

    Enjoy :)

    0 讨论(0)
  • 2020-12-19 06:08

    In case someone else got the same issue, I did this to fix my issue:

    1. Update Gems

      sudo gem update --system

    2. Uninstalled xcodeproj

      sudo gem uninstall xcodeproj

    3. Make sure to select All versions

    4. Uninstalled Cocoapods

      sudo gem uninstall cocoapods

    5. Install xcodeproj

      sudo gem install xcodeproj

    6. Install cocoapods

      sudo gem install cocoapods

    7. Run

      pod --version to test.

    0 讨论(0)
  • 2020-12-19 06:11

    You just have to execute this commande before :

    sudo gem install cocoapods
    

    This will update all outdated gems

    0 讨论(0)
  • 2020-12-19 06:13

    I had to uninstall the entire dependency chain for cocoapods to get it to work.

    for i in `gem list --no-versions`; do gem uninstall -aIx $i; done
    

    see Uninstall all installed gems, in OSX?

    0 讨论(0)
  • 2020-12-19 06:14

    Running these 2 lines will resolve your problem

    sudo gem update --system

    sudo gem install cocoapods

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