安装ruby gem json v1.8.3时出错:BFD(用于Debian的GNU Binutils)2.22内部错误

安装ruby gem json v1.8.3时出错:BFD(用于Debian的GNU Binutils)2.22内部错误,ruby,json,linux,compiler-errors,binutils,Ruby,Json,Linux,Compiler Errors,Binutils,我在尝试安装时看到类似于C编译器的错误 下面是我正在运行的命令: gem install json -v '1.8.3' 我的输出是: Building native extensions. This could take a while... ERROR: Error installing json: ERROR: Failed to build gem native extension. /usr/local/rvm/rubies/ruby-2.2.1/bin

我在尝试安装时看到类似于C编译器的错误

下面是我正在运行的命令:

gem install json -v '1.8.3'
我的输出是:

Building native extensions.  This could take a while...
ERROR:  Error installing json:
        ERROR: Failed to build gem native extension.

    /usr/local/rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20160327-27188-189i1cj.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling generator.c
linking shared-object json/ext/generator.so
/usr/bin/ld: BFD (GNU Binutils for Debian) 2.22 internal error, aborting at ../../bfd/reloc.c line 443 in bfd_get_reloc_size

/usr/bin/ld: Please report this bug.

collect2: error: ld returned 1 exit status
make: *** [generator.so] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.2.1/gems/json-1.8.3 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/json-1.8.3/gem_make.out
我尝试删除和安装包binutilsbuild-essential,但这并没有解决问题

关于我的操作系统的一些事实:

Debian GNU/Linux 7.9 (wheezy)
联埃援助团-a显示:

Linux Prometheus 2.6.32-042stab112.15 #1 SMP Tue Oct 20 17:22:56 MSK 2015 x86_64 GNU/Linux
我在OpenVZ虚拟化VPS主机上运行这个

My/etc/apt/sources.list(如果有帮助):

谷歌为谷歌提供零相关结果

BFD (GNU Binutils for Debian) 2.22 internal error, aborting at ../../bfd/reloc.c line 443 in bfd_get_reloc_size
如果由于链接器错误,我无法“生成”json gem,请建议我正确的方向,也许我可以用另一个版本替换编译器/链接器,或者以某种方式避免从源代码安装东西?一般来说,只要有助于安装json gem并继续执行我的计划,任何解决方案都是受欢迎的


非常感谢

安装新版本的binutils为我解决了这个问题

根据Alxs的建议,我已经安装了binutils 2.26-8。我不得不加上这句话:

deb http://ftp.de.debian.org/debian sid main
deb http://ftp.de.debian.org/debian sid main
到我的
/etc/apt/sources.list
,然后我运行

apt-get update
apt-get install binutils
它将binutils更新为2.26

然后我又跑了起来:

gem install json -v '1.8.3'
这次进展顺利

重要提示:不要忘记删除此行:

deb http://ftp.de.debian.org/debian sid main
deb http://ftp.de.debian.org/debian sid main

完成后,从您的
/etc/apt/sources
.list开始,否则您将继续从
sid
repo安装未来的软件包,这可能不是您需要的

试试2.25或2.26 Binutils,因为你的2.22版本已经很旧了。

试试2.25或2.26
Binutils
。你能展示一下
uname-a
?@AlexD uname-a:Linux-Prometheus 2.6.32-042stab112.15#1 SMP Tue 10月20日17:22:56 MSK 2015 x86_64 GNU/linuzy你的内核已经过时了。看起来你是在某种虚拟化环境下运行你的系统——谷歌说它很可能是旧rhel6环境下的OpenVZ。您的问题可能是由于旧内核和新的用户空间工具之间的不兼容造成的,或者您遇到了一些内存或虚拟化设置的其他限制。@AlexD感谢您的输入,我确实是在VPS上运行的(我已经用新信息更新了我的票证),但它有6GB内存,大部分是免费的(如free命令所示),嗯,我可能对这方面不太了解,但看起来这不应该是内存限制的问题。另一方面,我不太可能在这台服务器上升级内核,所以我可以尝试其他事情吗?请参阅下面关于如何从不稳定安装单个软件包的内容。有关我完成的确切步骤,请参阅下面我自己的答案。