Installation issue for Ubuntu 14.04.3 LTS

90 views
Skip to first unread message

Eric Gascoine

unread,
Aug 20, 2015, 7:47:20 AM8/20/15
to nokogiri-talk
I have found that there's another dependency that it required to build the nokogiri gem.

I needed to install the libgmp-dev package as well to satisfy the requirements for the extension build.

I'm using the 14.04 LTS with the kde-desktop, so I'm not sure if this was previously installed by default or by a dependency which is no longer there on my system.

-Eric.

Mike Dalessio

unread,
Aug 20, 2015, 8:05:57 AM8/20/15
to nokogiri-talk


On Aug 20, 2015 7:47 AM, "Eric Gascoine" <eric.g...@gmail.com> wrote:
>
> I have found that there's another dependency that it required to build the nokogiri gem.
>
> I needed to install the libgmp-dev package as well to satisfy the requirements for the extension build.
>

How did you reach this conclusion? Can you please share your log files?

My personal laptop is Ubuntu 14.04 and I don't have this library installed, so I'm curious to see what's going on.

> I'm using the 14.04 LTS with the kde-desktop, so I'm not sure if this was previously installed by default or by a dependency which is no longer there on my system.
>
> -Eric.
>

> --
> 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 http://groups.google.com/group/nokogiri-talk.
> For more options, visit https://groups.google.com/d/optout.

Gerald Hofmaier

unread,
Sep 5, 2015, 11:15:16 AM9/5/15
to nokogiri-talk
I ran into the same issue - also solved by installing libgmp-dev package - (thank you Eric !)
Here are a copy of my logs

System description:


gerald@gerald-VirtualBox:~/code/rails-i18n$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty
gerald@gerald-VirtualBox:~/code/rails-i18n$ ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
-------------------------------------------------------------------------

gem_make.out:



/home/gerald/.rvm/rubies/ruby-2.2.3/bin/ruby -r ./siteconf20150905-15835-17vnavf.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=/home/gerald/.rvm/rubies/ruby-2.2.3/bin/$(RUBY_BASE_NAME)
--help
--clean
/home/gerald/.rvm/rubies/ruby-2.2.3/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 /home/gerald/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/mkmf.rb:571:in `block in try_compile'
from /home/gerald/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/mkmf.rb:522:in `with_werror'
from /home/gerald/.rvm/rubies/ruby-2.2.3/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 /home/gerald/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/mkmf.rb:619:in `with_cflags'
from extconf.rb:86:in `add_cflags'
from extconf.rb:337:in `<main>'

extconf failed, exit code 1

---------------------------------------------------------------------------------------------

mkmf.log:


"gcc -o conftest -I/home/gerald/.rvm/rubies/ruby-2.2.3/include/ruby-2.2.0/x86_64-linux -I/home/gerald/.rvm/rubies/ruby-2.2.3/include/ruby-2.2.0/ruby/backward -I/home/gerald/.rvm/rubies/ruby-2.2.3/include/ruby-2.2.0 -I.     -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat  -fPIC  conftest.c  -L. -L/home/gerald/.rvm/rubies/ruby-2.2.3/lib -Wl,-R/home/gerald/.rvm/rubies/ruby-2.2.3/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic     -Wl,-rpath,'/../lib' -Wl,-R'/../lib' -lruby  -lpthread -lgmp -ldl -lcrypt -lm   -lc "
/usr/bin/ld: cannot find -lgmp
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 */

Lars Kanis

unread,
Sep 7, 2015, 6:01:15 AM9/7/15
to nokogi...@googlegroups.com
Nokogiri has no direct dependency to libgmp. Possibly Ruby was compiled with gmp-support enabled? Do other gems build? "gem install ffi" for instance?

--
Regards,
Lars

Gerald Hofmaier

unread,
Sep 7, 2015, 3:53:48 PM9/7/15
to nokogi...@googlegroups.com
Similar issue with atomic gem .
Ruby was compiled rvm.

--
You received this message because you are subscribed to a topic in the Google Groups "nokogiri-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nokogiri-talk/IsmbRso-ghg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nokogiri-tal...@googlegroups.com.

Gerald Hofmaier

unread,
Sep 7, 2015, 3:54:29 PM9/7/15
to nokogi...@googlegroups.com
Similar issue with atomic gem .
Ruby was compiled via rvm.

Mike Dalessio

unread,
Sep 8, 2015, 8:33:34 AM9/8/15
to nokogiri-talk
Lars is absolutely correct, there's no dependency by nokogiri on libgmp. If this is coming from anywhere, it's coming from your ruby build.

Which, of course, begs the question of: how did this Ruby get built on your machine if this library wasn't installed?

Did you upgrade or reinstall your Linux distro and leave this version of Ruby hanging around in your ~/.rvm directory from before the upgrade?



Gerald Hofmaier

unread,
Sep 10, 2015, 4:22:43 PM9/10/15
to nokogi...@googlegroups.com
No it's a "clean" ubuntu image installed in Virtual Box with RVM and ruby installed following the RVM guide https://rvm.io/rvm/install

I did upgrade via RVM from ruby-2.1.5 [ x86_64 ] to   ruby-2.2.3 .

--
You received this message because you are subscribed to a topic in the Google Groups "nokogiri-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nokogiri-talk/IsmbRso-ghg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nokogiri-tal...@googlegroups.com.

Mike Dalessio

unread,
Sep 11, 2015, 11:17:14 AM9/11/15
to nokogiri-talk

Can you help me reproduce this? What versions are you using of:

- rvm
- Ubuntu

I would like to be able to see this fail in the expected way, so that I can understand root causes.

Lars Kanis

unread,
Sep 11, 2015, 11:59:35 AM9/11/15
to nokogi...@googlegroups.com
Hi all,

I did a quick check with rake-compiler-dock (which coincidentally is based on Ubuntu-14.04). It has no libgmp-dev package installed and rvm install looks like this:

lars@d14816859b44:/home/lars/comcard/nokogiri$ rvm install 2.2.3
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/ubuntu/14.04/x86_64/ruby-2.2.3.tar.bz2
Checking requirements for ubuntu.
Requirements installation successful.
ruby-2.2.3 - #configure
ruby-2.2.3 - #download
 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                Dload  Upload   Total   Spent    Left  Speed
 0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 22.9M  100 22.9M    0     0   864k      0  0:00:27  0:00:27 --:--:-- 1232k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.2.3 - #validate archive
ruby-2.2.3 - #extract
ruby-2.2.3 - #validate binary
ruby-2.2.3 - #setup
ruby-2.2.3 - #gemset created /usr/local/rvm/gems/ruby-2.2.3@global
ruby-2.2.3 - #importing gemset /usr/local/rvm/gemsets/global.gems...................................
ruby-2.2.3 - #generating global wrappers........
ruby-2.2.3 - #gemset created /usr/local/rvm/gems/ruby-2.2.3
ruby-2.2.3 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.2.3 - #generating default wrappers........
lars@d14816859b44:/home/lars/comcard/nokogiri$  
lars@d14816859b44:/home/lars/comcard/nokogiri$  
lars@d14816859b44:/home/lars/comcard/nokogiri$ ldd /usr/local/rvm/rubies/ruby-2.2.3/lib/libruby.so
       linux-vdso.so.1 =>  (0x00007ffd3c640000)
       libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc87bfde000)
       libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fc87bd6a000)
       libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc87bb66000)
       libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007fc87b92d000)
       libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc87b627000)
       libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc87b262000)
       /lib64/ld-linux-x86-64.so.2 (0x00007fc87c6dc000)

So the root cause is that rvm installes a binary ruby, which is linked to libgmp, but doesn't install the libgmp-dev package. Ruby runs fine this way, but extensions will not compile. So IMHO this is a rvm issue.

--
Regards,
Lars

Gerald Hofmaier

unread,
Sep 12, 2015, 4:40:30 AM9/12/15
to nokogi...@googlegroups.com
I was using rvm 1.26.3 (latest) and Ubuntu 14.04.3 LTS.
Looks like Lars has got to the bottom of the issue. I will post a ticket with RVM if Lars has not already done so.
Many thanks,
Gerald

Mike Dalessio

unread,
Sep 13, 2015, 11:38:24 AM9/13/15
to nokogiri-talk
Looks like Gerald opened an issue with RVM here:


Thanks to everyone for helping diagnose this!


--
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.
Reply all
Reply to author
Forward
0 new messages