How to install therubyracer on aarch64 using using preinstalled libv8 gem and precompiled v8 dependencies?

778 views Asked by At

I've been trying to install therubyracer gem on an aarch64 device. I cross-compiled v8 from source (I have got an arm64.release folder resulting from the compilation) but do not know where to put it. I also managed to successfully install libv8 by downloading a .gem file of the version I needed for arm from rubygems and I installed it by running gem install path_to_gem. I also added this to the gemfile:

gem 'libv8', path: '~/.gem/ruby/1.9.1/gems/libv8-3.16.14.11'

However, when I run bundle install and it tries to install therubyracer, I get errors because it tries to compile the dependency again, although it is already installed. I guess it does not detect libv8 is already installed. I also do not know where to put the cross-compiled v8 so my system detects it. I am using a version of an arm64 ubuntu.

Doing gem install therubyracer -v '0.12.2' -- --with-system-v8 does not work either and it tries to compile v8 anyway.

Note that I need everything to be compatible with ruby 1.9.3 and rails 3.2, and I need to use it on a aarch64/arm64 device.

I tried asking on therubyracer github but got no answer since it is quite old.

1

There are 1 answers

4
jmrk On

I need to use an older version of these libraries (therubyracer 0.12.2, libv8 3.16.14) and I need to use them on a aarch64/arm64 device

Unfortunately, V8 3.16.14 (dated February 2013!) does not support arm64. Support for arm64 was landed about a year later, initially under the name "a64", renamed to "arm64" after a couple of weeks.

If you're running an arm32+arm64 "multilib" configuration on your device (which Ubuntu supports but doesn't recommend), you could try getting the 32-bit ARM versions of V8 and therubyracer working. (I don't know how exactly that would be done or whether there will be other obstacles; the libv8 gem mentions an issue but that doesn't seem relevant to your situation.)