简体   繁体   中英

Trying to install ruby 1.9.3 on Alpine 3.4 fails

I'm trying to build an alpine:3.4 image with ruby 1.9.3 using rvm but I get the following error message:

io.o: In function `linux_iocparm_len':
/home/travis/.rvm/src/ruby-1.9.3-p551/io.c:8086: undefined reference to `_IOC_SIZE'
collect2: error: ld returned 1 exit status
Makefile:165: recipe for target 'miniruby' failed

I've been able to install both ruby 2.2 and 2.3 without any problems, but had no luck with 1.9.3

The command I used for 2.3 is

rvm install 2.3.0 --disable-binary --movable --autolibs=0

I've installed rvm from https://github.com/rvm/rvm/archive/stable.tar.gz

I solved this by backporting the same conditionals the latest version of Ruby has for _IOC_SIZE to ruby/io.c . I was able to compile and install afterwards.

The pull request is https://github.com/ruby/ruby/pull/1485 , the fix is https://github.com/rallen-temp/ruby/commit/cbaaf34a0aa3c90f6a43d4383258c14a803bed12 .

I also referenced this issue in the PR. Hope this helps anyone else that runs into this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM