Forum: Ruby on Rails Error installing therubyracer

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
78110d6853aefd7271296799a6dab3c2?d=identicon&s=25 tfp44 (Guest)
on 2012-05-18 16:20
(Received via mailing list)
I'm struggling to install therubyracer gem. Using CentOS 6.2 x86_64,
ruby 1.9.3p194, gem 1.8.24, libv8 (, x86_64-linux)

Trying to install therubyracer gives me:

Building native extensions.  This could take a while...
ERROR:  Error installing therubyracer:
        ERROR: Failed to build gem native extension.

        /usr/local/bin/ruby extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
extconf.rb:15:in `<main>': undefined method `include_path' for
Libv8:Module (NoMethodError)

Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/
therubyracer-0.10.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/

Any ideas?
78110d6853aefd7271296799a6dab3c2?d=identicon&s=25 tfp44 (Guest)
on 2012-05-19 17:37
(Received via mailing list)
Don't suppose anyone else has had any problems installing
therubyracer? Is there anything particular to look out for installing
on 64-bit linux?
6d6f3cc222aa7a7df4fb3b8105d3d310?d=identicon&s=25 Meck Z. (meck_z)
on 2012-05-19 19:11
Try this:

$ gem uninstall libv8
$ gem install therubyracer

It works for me.
D81137c3ac6e2bf9471c3029a0f38a6b?d=identicon&s=25 Rocky (Guest)
on 2012-05-22 00:15
(Received via mailing list)
Rails hosts, for instance Heroku, are strongly advising against
therubyracer because of memory usage.
I removed therubyracer from my gems and just did $sudo apt-get install

Not sure if that is the preferred method, but it works for me.
7aa4e8334b4fed3a7e1c71dd950c5543?d=identicon&s=25 Vivek G. (vivek_g)
on 2012-05-22 02:43
Just wanted to mention that I performed the steps mentioned by Meck Z.
on osx lion to deal with the same issue. (was playing with fatfreecrm
which now apparently uses therubyracer). Thanks!
10daa548933249f5cfc995c8479455dc?d=identicon&s=25 Keith Posehn (zorz)
on 2012-08-09 03:45
I found a similar problem, but got a little nugget of info in the error
on OS X 10.8 Mountain Lion:

compiling rr.cpp
make: g++-4.2: No such file or directory
make: *** [rr.o] Error 1

I found that all you need to do on Mountain Lion is:

1: Make sure you've installed Xcode command line tools so that the g++
directory is in /usr/bin
2: Type "sudo ln -s g++ g++-4.2"

Enjoy :)
D36f5a1335f3479e2465209d0a858a96?d=identicon&s=25 John RLive (johnrlive)
on 2012-08-21 22:51
Thanks zorz that worked for me. However anytime I type anything in
terminal I get this line after:

"-bash: __git_ps1: command not found"

is there a way to get rid of this?
1e2f907b5827a6f705d61c04d5e24bfc?d=identicon&s=25 Sam Woodard (swoodard)
on 2012-09-10 22:44
@johnrlive install git with homebrew rather than relying on the os x
041cf1f9a7fc3e0a13b46b6142a7f695?d=identicon&s=25 Lasse Bunk (metric)
on 2013-11-01 11:59
Meck Z. wrote in post #1061376:
> Try this:
> $ gem uninstall libv8
> $ gem install therubyracer
> It works for me.

Worked for me too.
094df4fb5e2904f0e4531fa06d8623f5?d=identicon&s=25 Karen Carias (karen)
on 2015-04-18 06:52
There's an official Omnibus package for the RPi2, see 'Omnibus package
for Raspberry Pi 2' on
This topic is locked and can not be replied to.