加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

捆绑安装错误“yajl-ruby”

发布时间:2020-12-17 04:34:13 所属栏目:百科 来源:网络整理
导读:noob在这里,我正在尝试安装octopress但是当我运行rbenv exec bundle install时出现了这个错误. Gem::Ext::BuildError: ERROR: Failed to build gem native extension.current directory:/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/yajl-ru
noob在这里,我正在尝试安装octopress但是当我运行rbenv exec bundle install时出现了这个错误.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/yajl-ruby-1.2.1/ext/yajl
/home/idiot/.rbenv/versions/2.4.0/bin/ruby -r ./siteconf20170227-4161-uizrqn.rb extconf.rb
creating Makefile

current directory:
/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/yajl-ruby-1.2.1/ext/yajl
make "DESTDIR=" clean

current directory:
/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/yajl-ruby-1.2.1/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: In function ‘rb_yajl_parser_parse’:
yajl_ext.c:471:17: warning: variable ‘stat’ set but not used [Wunused-but-set-variable]
yajl_status stat;
             ^~~~
yajl_ext.c: In function ‘rb_yajl_encoder_enable_json_gem_ext’:
yajl_ext.c:881:22: error: ‘rb_cFixnum’ undeclared (first use in this function)
rb_define_method(rb_cFixnum,"to_json",rb_yajl_json_ext_fixnum_to_json,-1);
                  ^~~~~~~~~~
yajl_ext.c:881:22: note: each undeclared identifier is reported only once for each
function it appears in
yajl_ext.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
make: *** [Makefile:242: yajl_ext.o] Error 1

make failed,exit code 2

Gem files will remain installed in
/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/yajl-ruby1.2.1 for inspection.
Results logged to
  /home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0-static/yajl-ruby-1.2.1/gem_make.out

An error occurred while installing yajl-ruby (1.2.1),and Bundler cannot
continue.
Make sure that `gem install yajl-ruby -v '1.2.1'` succeeds before bundling.

我试过谷歌搜索,但仍然没有找到解决这个问题的方法,任何人都回答我的问题,我非常感激.

解决方法

尚未针对Ruby 2.4更新本机扩展.突破性变化是Fixnum和Bignum(C API中的rb_cFixnum和rb_cBignum)已在Integer(rb_cInteger)中统一.

检查yajl-ruby存储库以查找修复Ruby 2.4兼容性的问题/拉取请求或暂时使用Ruby 2.3.3.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读