更新到macOS Catalina 在打开终端时出现错误

ERROR:  Can't find Ruby library file or shared library colorls
usage: dirname path
/Users/varunsukheja/.zshrc:source:91: no such file or directory: /tab_complete.sh

当我检查第91行的.zshrc文件时,发现下面的行
source $(dirname $(gem which colorls))/tab_complete.sh

在检查gem which colorls时出现以下错误
ERROR:  Can't find Ruby library file or shared library colorls

但是当我检查which colorls时,我得到了下面的路径
/usr/local/bin/colorls

我也尝试使用gem再次安装colorls
Building native extensions. This could take a while...
ERROR:  Error installing colorls:
    ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/clocale-0.0.4/ext/clocale
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /Library/Ruby/Site/2.6.0 -r ./siteconf20191009-43313-16ndnb.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h

You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/clocale-0.0.4 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/clocale-0.0.4/gem_make.out

请帮助如何使其工作。

最佳答案

这为我工作:
xcode-select --installsudo gem install colorls -n /usr/local/bin

关于Macos Catalina更新: unable to run colorls后出现错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/58303940/

10-09 07:06