foodcritic (3.0.3) gem 在 Mac OS High Sierra 中安装失败

foodcritic (3.0.3) gem installation is failing in Mac OS High Sierra

我的美食评论家 gem 安装失败并出现以下错误

Following gems were not installed:
foodcritic (3.0.3): Error installing foodcritic
ERROR: Failed to build gem native extension. current directory
/Users/dmanna/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yajl-ruby-1.1.0/ext/yajl
/Users/dmanna/.rbenv/versions/2.5.1/bin/ruby -r ./siteconf/20180729-63637-1dtcegj.rb.extconf.rb creating Makefile current
directory: /Users/dmanna/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yajl-ruby-1.1.0/ext/yajl make "DESTDIR=" clean current
directory: /Users/dmanna/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yajl-ruby-1.1.0/ext/yajl make "DESTDIR=" compiling
yajl.c compiling yajl_alloc.c compiling yajl_buf.c compiling yajl_encode.c compiling yajl_ext.c yajl_ext.c:852:22 error: use of undeclared identifier 'rb_cFixnum' rb_define_method(rb_cFixnum, "to_json", rb_yajl_json_ext_fixnum_to_json, -1); ^ 1 error generated.

make: *** [yajl_ext.o] Error 1 make failed, exit code 2 Gem files remain installed in 
/Users/dmanna/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yajl-ruby-1.1.0 for inspection. Results logged to
/Users/dmanna/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-17/2.5.0-static/yajl-ruby-1.1.0/gem_make.out

gem_make.out

的输出
current directory: /Users/dmanna/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yajl-ruby-1.1.0/ext/yajl
/Users/dmanna/.rbenv/versions/2.5.1/bin/ruby -r ./siteconf20180729-63637-1dtcegj.rb extconf.rb
creating Makefile

current directory: /Users/dmanna/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yajl-ruby-1.1.0/ext/yajl
make "DESTDIR=" clean

current directory: /Users/dmanna/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yajl-ruby-1.1.0/ext/yajl
make "DESTDIR="
compiling yajl.c
compiling yajl_alloc.c
compiling yajl_buf.c
compiling yajl_encode.c
compiling yajl_ext.c
yajl_ext.c:852:22: error: use of undeclared identifier 'rb_cFixnum'
    rb_define_method(rb_cFixnum, "to_json", rb_yajl_json_ext_fixnum_to_json, -1);
                     ^
1 error generated.
make: *** [yajl_ext.o] Error 1

make failed, exit code 2

我是 ruby 的新手。尝试在 RubyMine 中导入项目并安装 gems.

时出现此错误

谁能告诉我出了什么问题,我该如何解决这个问题?

Foodcritic 3.0.3 来自 2013 年。参见此处:
https://rubygems.org/gems/foodcritic/versions/3.0.3

很遗憾,它与最新版本的 Ruby 不兼容。您的选择是将 Ruby 降级到 2.4 以下,甚至可能低至 1.9 以确保兼容性,或者将 foodcritic 升级到最新版本 (14.0.0)。