Macos Catalina error after update: unable to run colorls

后端 未结 5 1085
无人共我
无人共我 2021-02-14 02:25

Updating to macOS Catalina gives error on opening terminal

ERROR:  Can\'t find Ruby library file or shared library colorls
usage: dirname path
/         


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-14 03:05

    Here is how I solved it:

    1. sudo xcode-select --install
    2. Install rbenv with brew install rbenv
    3. Add eval "$(rbenv init -)" to the end of ~/.zshrc or ~/.bash_profile
    4. Install a ruby version rbenv install 2.6.0
    5. Select a ruby version by rbenv rbenv global 2.6.0
    6. Open a new terminal window.
    7. Verify that the right gem folder is being used with 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.

提交回复
热议问题