Make a mistake installing ruby ​​gem json v1.8.3: BFD (GNU Binutils for Debian) 2.22 internal error

I see something similar to a C compiler error when I try to install ruby gem json 1.8.3

The command is executed here:

gem install json -v '1.8.3' 

And my conclusion:

 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 

I tried uninstalling and installing binutils and build-essential packages, but this did not solve the problem.

Some facts about my OS:

 Debian GNU/Linux 7.9 (wheezy) 

uname -a shows:

 Linux Prometheus 2.6.32-042stab112.15 #1 SMP Tue Oct 20 17:22:56 MSK 2015 x86_64 GNU/Linux 

I run this on an OpenVZ virtual VPS server.

My / etc / apt / sources.list (if that helps):

 deb http://ftp.debian.org/debian wheezy main contrib non-free deb http://security.debian.org wheezy/updates main contrib non-free deb http://packages.icinga.org/debian icinga-wheezy main deb http://http.debian.net/debian wheezy-backports main deb-src http://packages.icinga.org/debian icinga-wheezy main 

Google produces zero relevant results for

 BFD (GNU Binutils for Debian) 2.22 internal error, aborting at ../../bfd/reloc.c line 443 in bfd_get_reloc_size 

If I can’t “create” json gem due to a linker error, please let me know in the right direction, maybe I can replace the compiler / linker with a different version or somehow bypass the installation of things from the source here? In general, any solution is appreciated as soon as it helps to install json gem and continue my plan.

Thank you very much in advance!

+5
source share
2 answers

Try 2.25 or 2.26 Binutils, as your version 2.22 is pretty old.

+4
source

Installing a new version of binutils solved the problem for me.

According to Alxs recommendations, I installed binutils 2.26-8. I had to add this line:

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

To my /etc/apt/sources.list , I ran

 apt-get update apt-get install binutils 

What updated binutils to 2.26

Then I ran again:

 gem install json -v '1.8.3' 

And this time everything turned out smoothly.

IMPORTANT: do not forget to delete this line:

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

from your /etc/apt/sources .list after you are done, otherwise you will continue to install future packages from sid repo from now on, which is probably not the way you need it.

+4
source

Source: https://habr.com/ru/post/1245845/


All Articles