Ruby 2.3.0 fails to build

3 posts / 0 new
Last post
#1 Thu, 2016-03-24 09:56
sig
  • sig's picture
  • Offline
  • Last seen: 2 years 3 days ago
  • Joined: 2016-03-24

Hello everyone.
I'm trying to install Ruby 2.3.0 on Alpine 3.3.1 but I got the following error

BUILD FAILED (Alpine Linux 3.3.1 using ruby-build 20160228)
 
Inspect or clean up the working tree at /tmp/ruby-build.20160324085357.29
Results logged to /tmp/ruby-build.20160324085357.29.log
 
Last 10 log lines:
compiling numeric.c
compiling object.c
compiling pack.c
compiling parse.c
compiling process.c
compiling random.c
random.c:525:26: fatal error: linux/random.h: No such file or directory
compilation terminated.
Makefile:375: recipe for target 'random.o' failed
make: *** [random.o] Error 1

Is there a package I can install to fix this issue?

Thanks and have a nice day

Thu, 2016-03-24 13:54
elifarley
  • elifarley's picture
  • Offline
  • Last seen: 2 years 1 week ago
  • Joined: 2016-03-24

Try installing linux-headers and jemalloc-dev.

However, you'll probably hit another bug. In my case, I'm compiling with these commands:

curl "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.gz" | tar -xz && cd ruby-2.3.0 && \
  ./configure --enable-shared --with-jemalloc --disable-install-doc && \
  make -j4 && make install && \
  rm /usr/local/lib/libruby-static.a

----------

And here's the error message I get:

[...]
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-musl/5.3.0/lto-wrapper
Target: x86_64-alpine-linux-musl
Configured with: /home/buildozer/aports/main/gcc/src/gcc-5.3.0/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --build=x86_64-alpine-linux-musl 
--host=x86_64-alpine-linux-musl --target=x86_64-alpine-linux-musl --with-pkgversion='Alpine 5.3.0' --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch
 --disable-multilib --disable-nls --disable-werror --disable-symvers --enable-__cxa_atexit --enable-esp --enable-cloog-backend --enable-languages=c,c++,objc,java,fortran,
ada --disable-libssp --disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads --enable-tls --with-system-zlib
Thread model: posix
gcc version 5.3.0 (Alpine 5.3.0) 
./tool/mkconfig.rb: [BUG] Segmentation fault at 0x00000000000010
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
 
-- Control frame information -----------------------------------------------
c:0001 p:0000 s:0002 E:000f70 (none) [FINISH]
 
 
-- Machine register context ------------------------------------------------
 RIP: 0x00007fe07c7cd5a5 RBP: 0x000055623d794d70 RSP: 0x00007ffd2e31a358
 RAX: 0x0000000000000000 RBX: 0x0000000000000000 RCX: 0x0000000000000013
 RDX: 0x0000000000000000 RDI: 0x000055623d794d70 RSI: 0x0000000000000013
  R8: 0xfefefefefefefeff  R9: 0x00000000000001c8 R10: 0xfefefefefefefeff
 R11: 0x0000000000000246 R12: 0x0000000000000013 R13: 0x00007fe07ca301b0
 R14: 0x00007fe07ca301a8 R15: 0x00007fe07ca2ffe0 EFL: 0x0000000000010206
 
-- Other runtime information -----------------------------------------------
 
* Loaded script: ./tool/mkconfig.rb
* Loaded features:
 
    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
[...]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: <a href="http://www.ruby-lang.org/bugreport.html
 
uncommon.mk:625:" rel="nofollow">http://www.ruby-lang.org/bugreport.html
 
uncommon.mk:625:</a> recipe for target '.rbconfig.time' failed
make: *** [.rbconfig.time] Aborted (core dumped)

Tue, 2016-03-29 05:12 (Reply to #2)
sig
  • sig's picture
  • Offline
  • Last seen: 2 years 3 days ago
  • Joined: 2016-03-24

Hi elifarley.
Adding linux-headers did the trick for me.

Thanks and have anice day.

Log in or register to post comments