Ruby无法加载此类文件-active_support / core_ext / object / blank


90

我正在尝试运行,brew doctor但系统弹出错误消息

/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:在`require'中:无法加载此类文件-active_support / core_ext /对象/空白(LoadError)

在线搜索,另一篇文章建议只是“ gem install activesupport”,但随后我遇到了以下错误:

ERROR:  Error installing activesupport:
    i18n requires Ruby version >= 2.3.0.

我也尝试过rvm安装ruby-2.3.0,但再次弹出相同的错误

[2019-02-26 10:07:41] requirements_osx_brew_libs_install
requirements_osx_brew_libs_install ()  { 
    brew install "$@" --force || { 
        \typeset ret=$?;
        requirements_osx_brew_libs_error "installation";
        return $ret
    } } current path: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
PATH=/Users/{user_name}/.aw/pex_resources/scripts/binaries:/usr/local/sbin:/Users/fengjiao/.rbenv/shims:/Users/{user_name}/.nvm/v0.10.32/bin:/Users/fengjiao/bin:/usr/local/sbin:/usr/local/bin:/Users/{user_name}/.rbenv/shims:/Users/{user_name}/.nvm/v0.10.32/bin:/Users/{user_name}/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/munki:/opt/X11/bin:/Users/fengjiao/gocode/bin:/Users/{user_name}/.rvm/bin
command(10): requirements_osx_brew_libs_install autoconf automake
libtool pkg-config coreutils libyaml readline libksba openssl@1.1
++ brew install autoconf automake libtool pkg-config coreutils libyaml readline libksba openssl@1.1 --force
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in
`require': cannot load such file --
active_support/core_ext/object/blank (LoadError)    from
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in
`require'   from /usr/local/Homebrew/Library/Homebrew/global.rb:10:in
`<top (required)>'  from
/usr/local/Homebrew/Library/Homebrew/brew.rb:21:in `require_relative'
    from /usr/local/Homebrew/Library/Homebrew/brew.rb:21:in `<main>'
++ typeset ret=1
++ requirements_osx_brew_libs_error installation
++ rvm_warn 'There were package installation errors, make sure to read the log.

Try `brew tap --repair` and make sure `brew doctor` looks reasonable.

Answers:


224

跑步brew style为我解决了这个问题。


更新资料

如评论中所述,对于某些人来说,解决方案是:

brew update-reset

32
@Mave对我来说是我跑步后发生的事情brew cleanup
BigHeadCreations

1
@crisscross请添加您的命令作为答案,这只是对我
有用的

@ BigHeadCreations,@ Mave:我能够确认这是在之后直接发生的brew cleanup。就在此之前,brew update表示更新了commit 6db1c7383brew update-reset解决了这个问题。
TrinitronX

1
谢谢!!我解决了使用我的问题brew update-reset
Adiyat穆巴拉克

1
适用于MacOS的10.15

43

有同样的问题。我不得不跑去brew update-reset修复它。


0

就我而言,我必须强制homebrew / linuxbrew使用其自己的Portable-ruby对其进行修复。

我正在ArchLinux的安装红宝石2.7.0,之后我通过切换到自制的便携式红宝石export HOMEBREW_FORCE_VENDOR_RUBY=1中所描述的联机帮助和问题brew update,自制自动下载便携式红宝石2.6.3,和一切都恢复正常。

我认为根本原因可能是自制软件与更高版本的红宝石不兼容。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.