Installation Error

258 views
Skip to first unread message

Clockwork

unread,
Dec 17, 2015, 6:39:04 PM12/17/15
to nokogiri-talk
Hi,
when i use:
gem install nokogiri
i get following error in mkmf.log:
 /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o: unrecognized relocation (0x2a) in section `.init'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

Anyone know a solution?

Mike Dalessio

unread,
Dec 17, 2015, 6:45:40 PM12/17/15
to nokogiri-talk
Hello,

Thanks for asking this question.

Can you please provide additional information about your system? Ideally enough information for us to reproduce the issue that you're seeing.


--
You received this message because you are subscribed to the Google Groups "nokogiri-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nokogiri-tal...@googlegroups.com.
To post to this group, send email to nokogi...@googlegroups.com.
Visit this group at https://groups.google.com/group/nokogiri-talk.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Clockwork

unread,
Dec 17, 2015, 11:36:24 PM12/17/15
to nokogiri-talk
uname -r
4.0.0-kali1-amd64 (I used Kali Mini Installation and added software from hand)

gem_make.out:
gem install nokogiri
Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
    ERROR: Failed to build gem native extension.

    /usr/bin/ruby2.2 -r ./siteconf20151218-2296-1vqscxo.rb extconf.rb
checking if the C compiler accepts ... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/bin/$(RUBY_BASE_NAME)2.2
    --help
    --clean
/usr/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /usr/lib/ruby/2.2.0/mkmf.rb:571:in `block in try_compile'
    from /usr/lib/ruby/2.2.0/mkmf.rb:522:in `with_werror'
    from /usr/lib/ruby/2.2.0/mkmf.rb:571:in `try_compile'
    from extconf.rb:80:in `nokogiri_try_compile'
    from extconf.rb:87:in `block in add_cflags'
    from /usr/lib/ruby/2.2.0/mkmf.rb:619:in `with_cflags'
    from extconf.rb:86:in `add_cflags'
    from extconf.rb:336:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.2.0/gems/nokogiri-1.6.7.1 for inspection.
Results logged to /var/lib/gems/2.2.0/extensions/x86_64-linux/2.2.0/nokogiri-1.6.7.1/gem_make.out

mkmf.log:
"gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -D_FORTIFY_SOURCE=2   -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC  conftest.c  -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-z,relro -L/build/ruby2.2-TAju0T/ruby2.2-2.2.3/debian/lib -fstack-protector -rdynamic -Wl,-export-dynamic     -lruby-2.2  -lpthread -lgmp -ldl -lcrypt -lm   -lc "

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o: unrecognized relocation (0x2a) in section `.init'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

Do you need anything else?

Clockwork

unread,
Dec 18, 2015, 12:18:06 AM12/18/15
to nokogiri-talk
ruby -v
ruby 2.2.3p173 (2015-08-18) [x86_64-linux-gnu]

Mike Dalessio

unread,
Dec 18, 2015, 1:57:29 PM12/18/15
to nokogiri-talk
I don't think this is a nokogiri-specific problem, but a problem with the libc on your system.

I googled and found this:


Can you compile other C extensions? What happens if you run `gem install bcrypt`?


Clockwork

unread,
Dec 18, 2015, 2:04:20 PM12/18/15
to nokogiri-talk
After Updating my system today, the error dont appear anymore. It worked fine!
Reply all
Reply to author
Forward
0 new messages