Updating to macOS Catalina gives error on opening terminal
ERROR: Can\'t find Ruby library file or shared library colorls
usage: dirname path
/
This fixed for me:
$ sudo gem update
$ sudo gem install colorls
Catalina now ships with Ruby 2.6, instead of 2.3. My guess is that with the upgrade, all custom installed gems became "untracked" by the new Ruby/Gem package system. With that, gem update
doesn't take care of updating colorls
.
Make sure you reinstall XCode command line tools, update/upgrade brew, npm and others.
Error: gem native extension error while installing cocoapods
Answer: Follow below 3 Steps issue will be fixed.
Step 1: Open XCode go to below path
XCode > Preferences > Locations > Command Line Tools (select-Xcode)
Step 2: Open Terminal- Paste the below Command
curl -L https://get.rvm.io | bash -s stable
Reopen Terminal -Paste the below Commands
Note: It will take 3-5 minutes
rvm install ruby-2.6
rvm use ruby-2.6.3
rvm --default use 2.6.3
Step3:
Open Terminal- Type below Command
sudo gem install cocoapods
Now gem native extension error while installing cocoapods will not come
Issue resolved.
This worked for me:
xcode-select --install
sudo gem install colorls -n /usr/local/bin
What solved it for me was to:
For some reason, there were no command line tools selected, so this caused issues for me. I downloaded a beta version of Xcode, and none were selected when I updated to the latest version.
Here is how I solved it:
sudo xcode-select --install
brew install rbenv
eval "$(rbenv init -)"
to the end of ~/.zshrc
or ~/.bash_profile
rbenv install 2.6.0
rbenv global 2.6.0
gem env home
(this should report something in your user folder, not system wide).After this I installed colorls again using sudo gem install colorls
If getting error:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
Try installing colorls using cmd:
sudo gem install colorls -n /usr/local/bin
After this you see colorls is installed successfully and new terminal works fine.