How to build JRuby 1.7.13 on Raspberry Pi with rbenv/ruby-build?

不想你离开。 提交于 2019-12-11 22:12:20

问题


I am trying to install JRuby (preferably version 1.7.13) onto a Raspberry Pi. I have rbenv/ruby-build installed. When I try to install JRuby (both 1.7.13 or 1.7.11), I get the following error:

pi@raspberrypi:~$ rbenv install jruby-1.7.13
Downloading jruby-bin-1.7.13.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/faa1cd590f32f3cb92044d9abedf66ccea1d93a24236c877810c9b30e1e0577c
Installing jruby-1.7.13...

BUILD FAILED

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

Last 10 log lines:
jruby-1.7.13/tool/nailgun/Makefile.in
jruby-1.7.13/tool/nailgun/ng.exe
jruby-1.7.13/tool/nailgun/README.txt
jruby-1.7.13/tool/nailgun/src/c/ng.c
/tmp/ruby-build.20140713094726.2669/jruby-1.7.13 /tmp/ruby-build.20140713094726.2669 ~
ERROR:  Loading command: install (LoadError)
    Could not load FFI Provider: (NotImplementedError) FFI not available: null
 See http://jira.codehaus.org/browse/JRUBY-4583
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

Is it possible to build JFFI for Linux on ARM and how would should I go about doing that?


回答1:


I believe the answer is to compile JFFI on the Raspberry Pi and copy the generated libjffi-1.2.so to /usr/lib. When I now try to install JRuby 1.7.13 using rbenv, I no longer get the missing FFI error but "Cannot allocate memory" errors.

The procedure I followed to compile libjffi was;

cd ~
pi@raspberrypi:~$ git clone git://github.com/jnr/jffi.git jffi.git
cd jffi.git
ant jar
sudo cp libjffi-1.2.so /usr/lib


来源:https://stackoverflow.com/questions/24718972/how-to-build-jruby-1-7-13-on-raspberry-pi-with-rbenv-ruby-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!