Macos Catalina 更新后出现错误:无法运行 colorls

2024-02-15

更新至 macOSCatalina打开终端时出错

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

当我检查 .zshrc 文件的第 91 行时,我发现以下行

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 --install sudo gem install colorls -n /usr/local/bin

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Macos Catalina 更新后出现错误:无法运行 colorls 的相关文章

随机推荐