I can not install therubyracer on Arch Linux x64

When I try to install therubyracer, I get the following error:

Installing therubyracer (0.11.0) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /home/carlos/.rbenv/versions/1.9.3-p327/bin/ruby extconf.rb checking for main() in -lpthread... yes checking for v8.h... yes creating Makefile make compiling script.cc compiling v8.cc compiling backref.cc compiling value.cc compiling accessor.cc compiling trycatch.cc compiling primitive.cc compiling external.cc compiling date.cc compiling exception.cc compiling init.cc compiling template.cc compiling message.cc compiling stack.cc compiling gc.cc compiling string.cc compiling handles.cc compiling function.cc compiling heap.cc compiling invocation.cc compiling locker.cc compiling object.cc compiling array.cc compiling constants.cc compiling rr.cc compiling signature.cc compiling constraints.cc compiling context.cc context.cc: In static member function 'static VALUE rr::Context::SetData(VALUE, VALUE)': context.cc:81:3: error: no matching function for call to 'v8::Context::SetData(rr::String)' context.cc:81:3: note: candidate is: In file included from rr.h:4:0, from context.cc:1: /usr/include/v8.h:3721:8: note: void v8::Context::SetData(v8::Handle<v8::Value>) /usr/include/v8.h:3721:8: note: no known conversion for argument 1 from 'rr::String' to 'v8::Handle<v8::Value>' make: *** [context.o] Error 1 Gem files will remain installed in /home/carlos/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/therubyracer-0.11.0 for inspection. Results logged to /home/carlos/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/therubyracer-0.11.0/ext/v8/gem_make.out An error occurred while installing therubyracer (0.11.0), and Bundler cannot continue. Make sure that `gem install therubyracer -v '0.11.0'` succeeds before bundling. 

I do not know what's happening.

+3
source share
4 answers

Actually, it was a bit complicated.

I use my own dotfiles , so I have ~/.dotfiles/bin in my PATH.

I also noticed that the problem is with python v3 vs v2 .

So the fix was pretty simple, without breaking my system:

 ln -s /usr/bin/python2 ~/.dotfiles/bin reload gem install libv8 --verbose bundle 

Leaving my Gemfile as follows:

 [...] gem 'therubyracer', :require => 'v8', :platforms => :ruby [...] 

And BOOM, it worked.

Thanks for the help. Sorry for the delay in reply.

Greetings


EDIT

The problem has been fixed in the new release of therubyracer (0.11.1).

+4
source

I have the same problem in ArchLinux. This is a known issue . the workaround that worked for mine on archlinux was blocked until 0.10.2 by adding the following line to the Gemfile

 gem 'therubyracer', '0.10.2', :platforms => :ruby 

I tested this and it works at least on 64bit. Hope this works for you too.

+3
source

I would highly recommend using an external Node.js (I'm sure there is an official package for this), and then use sstephenson / execjs ,

If you use Rails, it already depends on ExecJS , so you can just remove the dependency on therubyracer , bundle, install Node.js, and you're good to go.

+2
source

You need to install libv8 3.11.x to get the latest versions of therubyracer. So try updating libv8 and then run the package.

+1
source

All Articles