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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ruby无法加载此类文件 - active_support / core_ext / object / blank相关的知识,希望对你有一定的参考价值。

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

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

搜索在线和另一篇建议只是“宝石安装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 || { 
        	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 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.
答案

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


更新

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

brew update-reset
另一答案

有同样的问题。我不得不运行brew update-reset来解决它。

以上是关于Ruby无法加载此类文件 - active_support / core_ext / object / blank的主要内容,如果未能解决你的问题,请参考以下文章

乘客:无法加载此类文件 ruby​​gems/builder

安装 ruby​​-2.1.2:无法加载此类文件 -- openssl (LoadError)

Ruby on Rails:“无法加载此类文件”事件机器

Ruby 雾 gem 导致服务器无法运行:无法加载此类文件 -- xmlrpc/client (LoadError)

为啥我无法加载此类文件?

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