gem 无法下载json?报错-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

gem 无法下载json?报错

爱吃鱼的程序员 2020-06-10 14:53:00 173

centos源码安装gitlab,已经安装mysql,在安装gem的时候使用

sudo -u git -H bundle install --deployment --without development test postgres aws



提示错误

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



然后执行

gem install json -v '1.8.1'



报错

Fetching: json-1.8.1.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing json:
	ERROR: Failed to build gem native extension.

    current directory: /usr/local/lib/ruby/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
/usr/local/bin/ruby -r ./siteconf20160119-1952-glgiso.rb extconf.rb
creating Makefile

current directory: /usr/local/lib/ruby/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /usr/local/lib/ruby/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
../fbuffer/fbuffer.h:175:47: error: macro "rb_str_new" requires 2 arguments, but only 1 given
In file included from generator.c:1:
../fbuffer/fbuffer.h: In function ‘fbuffer_to_s’:
../fbuffer/fbuffer.h:175: warning: initialization makes integer from pointer without a cast
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/local/lib/ruby/gems/2.3.0/gems/json-1.8.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/json-1.8.1/gem_make.out



请问有人处理过这个问题么!!

JSON 关系型数据库 Shell Linux 开发工具 数据格式 git Ruby
分享到
取消 提交回答
全部回答(1)
  • 爱吃鱼的程序员
    2020-06-10 14:53:15

    嘿嘿,找到办法了!就是

    [root@test48gitlab]#vimGemfile.lock



    在里面找到json'1.8.1',修改成其他高级版本就可以了!

    0 0
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

推荐文章
相似问题