Reverting to a Working Version Of Xcode OR Don't use the Ruby installed by the OS

November 7, 2019 ยท 2 minute read

Tearing my hair out is a common occurrence whenever Apple has a hairy tingle up their bottoms and they decide to “update” Xcode with a more buggier version. It’s almost a feature at this point.

And since Xcode 11.2.0 is buggy as $hit (yes, my project has a TextView in a Storyboard), I had to remove it from my machine and revert back to a Xcode version I know that worked - Xcode 11.1, as 11.2 screwed up ALL THE THINGS.

Which meant that I have to reinstall Cocoapods and little did I know, also my own version of Ruby.

I got this beautiful error message trying to download Cocoapods:

% gem install cocoapods
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

I was shipped this default, but useless, version of Ruby from Apple:

% ruby -v  
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]

So I need to get my own Ruby in there by installing RVM, by using this command:

% \curl -sSL https://get.rvm.io | bash -s stable

Restart Terminal and then run:

% rvm install 2.6.0

And then when I ran Cocoapods again without a hick-up, all with no errors:

% gem install cocoapods 

To make sure I have the latest and greatest, I ran this command:

 % gem which cocoapods
/Users/yourUserName/.rvm/gems/ruby-2.6.0/gems/cocoapods-1.8.4/lib/cocoapods.rb

Double-checked to make sure my pods are up-to-date, and they were:

% pod repo

And that Homebrew doesn’t have an issue with anything:

% brew doctor
Your system is ready to brew.

So that finally I can install my Realm back on to my project.

% pod install 

There are times when I want to punch the Apple’s QA dudes right in the face…