本文介绍了Ruby 无法加载此类文件 - active_support/core_ext/object/blank的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行 brew doctor 但系统弹出错误

I was trying to run brew doctor but system popped up error of

/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require': 无法加载此类文件 --active_support/core_ext/object/blank (LoadError)

在网上搜索,另一个帖子建议只是gem install activesupport",但后来我遇到了错误:

Searched online and another post suggested to just "gem install activesupport" but then I ran into error of:

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

我也尝试 rvm install ruby​​-2.3.0 但同样的错误再次弹出

I also tried to rvm install ruby-2.3.0 but the same error popped again

[2019-02-26 10:07:41] requirements_osx_brew_libs_install
requirements_osx_brew_libs_install ()  {
    brew install "$@" --force || {
        	ypeset 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 [email protected]
++ brew install autoconf automake libtool pkg-config coreutils libyaml readline libksba [email protected] --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.

推荐答案

运行 brew style 为我解决了这个问题.

Running brew style fixed this issue for me.

更新

正如评论中提到的,对于某些人来说,解决方案是:

As mentioned in the comments, for some people the solution is:

brew update-reset

这篇关于Ruby 无法加载此类文件 - active_support/core_ext/object/blank的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 00:58