Ruby-build: Can't install ruby 2.3.0 on debian wheezy

Created on 3 Mar 2016  Â·  9Comments  Â·  Source: rbenv/ruby-build

I'm trying to install ruby 2.3.0 on debian wheezy but I got this error:

$ rbenv install 2.3.0
Downloading ruby-2.3.0.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.bz2
Installing ruby-2.3.0...

BUILD FAILED (Debian 7.7 using ruby-build 20160228-3-g37b3ded)

Inspect or clean up the working tree at /tmp/ruby-build.20160303160056.5246
Results logged to /tmp/ruby-build.20160303160056.5246.log

Last 10 log lines:
In file included from /usr/include/x86_64-linux-gnu/sys/syscall.h:31:0,
                 from /usr/include/syscall.h:1,
                 from random.c:81:
random.c: In function ‘fill_random_bytes_syscall’:
random.c:541:16: error: ‘__NR_getrandom’ undeclared (first use in this function)
  ret = syscall(SYS_getrandom, seed, size, flags);
                ^
random.c:541:16: note: each undeclared identifier is reported only once for each function it appears in
make: *** [random.o] Error 1

Any thoughts?

unconfirmed

Most helpful comment

The build fails because it cannot find the getrandom syscall. The getrandom call was introduced in version 3.17 of the Linux kernel (according to its man page). Debian Jessie comes with 3.16, so the build fails.

Ruby 2.3.1 can be compiled with older kernels of course. It tries to compile with getrandom because SYS_getrandom is defined in the file syscall.h. This file is added by the libc6-dev package:

$ apt-file search /usr/include/x86_64-linux-gnu/bits/syscall.h
libc6-dev: /usr/include/x86_64-linux-gnu/bits/syscall.h

For some mysterious reason my system had the wrong file and a package version that is not available for debian Jessie:

$ dpkg -l libc6-dev
...
ii libc6-dev:amd64 2.19-19 amd64 GNU C Library: Development Libraries and Header Files

The latest package version for Jessie is 2.19-18+deb8u4. Trying to reinstall the package fails and apt complains it has no way to download the package (the 2.19 version).

The solution for me was to remove the libc6-dev package and reinstall it from deb packages I downloaded manually from the debian site. I then repeated this for libc-dev-bin and finally installed with apt the packages that had to be removed in the process. Ruby 2.3.1 builds now.

All 9 comments

I have never seen this. Have you found a workaround since?

not yet! I don't have idea about this!

Same thing here... Debian Wheezy (Crunchbang Waldorf).

Same issue on Debian Jessie.

:+1: on Debian Jessie and installing ruby version 2.3.1

Same error on Jessie when installing 2.3.0/2.3.1.

I could only manage to install it, doing an apt-get upgrade
Worked after that.

The build fails because it cannot find the getrandom syscall. The getrandom call was introduced in version 3.17 of the Linux kernel (according to its man page). Debian Jessie comes with 3.16, so the build fails.

Ruby 2.3.1 can be compiled with older kernels of course. It tries to compile with getrandom because SYS_getrandom is defined in the file syscall.h. This file is added by the libc6-dev package:

$ apt-file search /usr/include/x86_64-linux-gnu/bits/syscall.h
libc6-dev: /usr/include/x86_64-linux-gnu/bits/syscall.h

For some mysterious reason my system had the wrong file and a package version that is not available for debian Jessie:

$ dpkg -l libc6-dev
...
ii libc6-dev:amd64 2.19-19 amd64 GNU C Library: Development Libraries and Header Files

The latest package version for Jessie is 2.19-18+deb8u4. Trying to reinstall the package fails and apt complains it has no way to download the package (the 2.19 version).

The solution for me was to remove the libc6-dev package and reinstall it from deb packages I downloaded manually from the debian site. I then repeated this for libc-dev-bin and finally installed with apt the packages that had to be removed in the process. Ruby 2.3.1 builds now.

I couldn't reproduce Ruby 2.3.1 on debian jessie(8.6). Please try to upgrade Ruby or debian box.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

florentmorin picture florentmorin  Â·  5Comments

k0kubun picture k0kubun  Â·  3Comments

noraj picture noraj  Â·  4Comments

williambsb picture williambsb  Â·  5Comments

CamJN picture CamJN  Â·  4Comments