Problem Installing OpenShift-cli on MacOS Mojave

installing openshift-cli on macos

Today, after upgrading to MacOS Mojave I wanted to also upgrade my Minishift installation and OpenShift-cli. Upgrading Minishift was quite straightforward but when I tried to install OpenShift-cli using homebrew I got the following error message:

brew install openshift-cli

– Error: Failure while executing: git config –replace-all homebrew.private true

Then I tried to manually upgrade git installation. I got the following error:

brew upgrade git

– xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

To solve this git upgrade problem I did:

xcode-select –install

This will download and install xcode developer tools and fix the problem.

Then I did:

brew install git

This time installation of the new git version was successfully completed.

Now it was time to try installing the OpenShift command line tools once more:

brew install OpenShift-cli

It was successfully completed. Now let’s try the command:

Serdars-MacBook-Pro:serdarosmanonur$ oc

– bash: /Users/serdarosmanonur/.minishift/cache/oc/v1.5.1/oc: No such file or directory

if you are getting an error like this, this means you need to update your path to point to the new oc executable.

Do this:

vi ~/.bash_profile

Add/modify the related line for your system:

export PATH=/Users/serdarosmanonur/.minishift/cache/oc/v3.10.0/darwin:$PATH

Reload bash to apply the PATH update:

exec bash

Run “oc” again and you should be good to go!

Hope this helps.

Good Luck,

Serdar