Can't install mechanize gem...

ant's Avatar


01 Jul, 2012 08:56 AM


I am having problems installing mechanize gem in my 64-bit Debian stable system:

gem install mechanize

Building native extensions. This could take a while...
ERROR: Error installing mechanize:

    ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb checking for main() in -lstdc++... yes
checking for ruby/encoding.h... no
creating Makefile
CXX is automatically set to g++

g++ -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -c
gcc -shared -o unf.o -L. -L/usr/lib -L. -rdynamic -Wl,-export-dynamic -lruby1.8 -lstdc++ -lpthread -lrt -ldl -lcrypt -lm -lc
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a(string-inst.o): relocation R_X86_64_32 against `std::basic_string<char, std::char_traits, std::allocator >::Rep::S_empty_rep_storage' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a: could not read symbols: Bad value collect2: ld returned 1 exit status
make: *** [] Error 1

Gem files will remain installed in /var/lib/gems/1.8/gems/unf_ext-0.0.5 for inspection.
Results logged to /var/lib/gems/1.8/gems/unf_ext-0.0.5/ext/unf_ext/gem_make.out

$ ruby --version ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
$ gem --version 1.3.7

How do I fix this? Thank you in advance. :)

  1. Support Staff 1 Posted by Eric Hodel on 03 Jul, 2012 08:18 PM

    Eric Hodel's Avatar

    This website is for support with RubyGems itself. Your error seems to be an error when installing the unf_ext gem. Please ask for help from the unf_ext gem's issue page.

  2. Eric Hodel closed this discussion on 03 Jul, 2012 08:18 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac