1

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.

raquelhortab
  • 430
  • 4
  • 13
  • 1
    I ended up realizing I don't really need therubyracer, it just comes by default. So I just removed the dependency. If anyone gets here trying to find a solution, I'm sorry, I did not find the way to install it. – raquelhortab Jan 12 '22 at 12:30

1 Answers1

0

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.)

jmrk
  • 34,271
  • 7
  • 59
  • 74
  • I was able to manually build and compile v8 for arm64 (crosscompile actually, I did it on a x64 laptop). The build script had the option to do that, so I guess that should mean it is supported, shouldn't it? – raquelhortab Dec 12 '21 at 15:40
  • Then you probably compiled a newer version; as I wrote above, arm64 has been supported since March 2014. 3.16.14 definitely has no support for arm64. – jmrk Dec 12 '21 at 15:55
  • You're right, I just checked and it seems I got the first one that is available for arm64 from rubygems: 5.7.4. Still, the problem is how to install therubyracer, any way to do this? I may be able to install a newer version as long as it supports ruby 1.9.3. I'll update the question so this is clear. Thanks – raquelhortab Dec 12 '21 at 17:04
  • I am now thinking that if I installed v 5.7.4, I don't know why there is a 3.16.14 folder on my ~/.gem folder. My device is out of battery now but I'll check as soon as I can. Maybe when installing from a .gem file it installs someplace else? Anyway, if anyone can come up with how to install the rubyracer with a prebuild v8 (which is not the same as libv8 afaik) that'd be amazing – raquelhortab Dec 12 '21 at 17:10