# Error installing therubyracer

**URL:** <https://www.ruby-forum.com/t/error-installing-therubyracer/219855>\
**Category:** Rails\
**Created:** [May 18, 2012, 4:20pm UTC](https://www.ruby-forum.com/t/error-installing-therubyracer/219855 "2012-05-18T16:20:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [May 18, 2012, 4:20pm UTC](https://www.ruby-forum.com/t/error-installing-therubyracer/219855/1 "2012-05-18T16:20:08Z")

</div>

I’m struggling to install therubyracer gem. Using CentOS 6.2 x86\_64,  
ruby 1.9.3p194, gem 1.8.24, libv8 (3.10.8.0, 3.3.10.4 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:  
–with-opt-dir  
–without-opt-dir  
–with-opt-include  
–without-opt-include=${opt-dir}/include  
–with-opt-lib  
–without-opt-lib=${opt-dir}/lib  
–with-make-prog  
–without-make-prog  
–srcdir=.  
–curdir  
–ruby=/usr/local/bin/ruby  
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/  
therubyracer-0.10.1/ext/v8/gem\_make.out

Any ideas?

---

<div class="post-metadata">

**Author:** ![tfp44](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/58956e/32.png) [@tfp44](https://www.ruby-forum.com/u/tfp44)\
**Post date:** [May 19, 2012, 5:37pm UTC](https://www.ruby-forum.com/t/error-installing-therubyracer/219855/2 "2012-05-19T17:37:42Z")

</div>

Don’t suppose anyone else has had any problems installing  
therubyracer? Is there anything particular to look out for installing  
on 64-bit linux?

---

<div class="post-metadata">

**Author:** ![tfp44](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/58956e/32.png) [@tfp44](https://www.ruby-forum.com/u/tfp44)\
**Post date:** [May 19, 2012, 7:11pm UTC](https://www.ruby-forum.com/t/error-installing-therubyracer/219855/3 "2012-05-19T19:11:48Z")

</div>

Try this:

$ gem uninstall libv8  
$ gem install therubyracer

It works for me.

---

<div class="post-metadata">

**Author:** ![tfp44](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/58956e/32.png) [@tfp44](https://www.ruby-forum.com/u/tfp44)\
**Post date:** [May 22, 2012, 12:15am UTC](https://www.ruby-forum.com/t/error-installing-therubyracer/219855/4 "2012-05-22T00:15:20Z")

</div>

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

Not sure if that is the preferred method, but it works for me.

---

<div class="post-metadata">

**Author:** ![tfp44](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/58956e/32.png) [@tfp44](https://www.ruby-forum.com/u/tfp44)\
**Post date:** [August 9, 2012, 3:45am UTC](https://www.ruby-forum.com/t/error-installing-therubyracer/219855/5 "2012-08-09T03:45:40Z")

</div>

I found a similar problem, but got a little nugget of info in the error  
on OS X 10.8 Mountain Lion:

make  
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 🙂

---

<div class="post-metadata">

**Author:** ![tfp44](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/58956e/32.png) [@tfp44](https://www.ruby-forum.com/u/tfp44)\
**Post date:** [May 22, 2012, 2:43am UTC](https://www.ruby-forum.com/t/error-installing-therubyracer/219855/6 "2012-05-22T02:43:14Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![tfp44](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/58956e/32.png) [@tfp44](https://www.ruby-forum.com/u/tfp44)\
**Post date:** [August 21, 2012, 10:51pm UTC](https://www.ruby-forum.com/t/error-installing-therubyracer/219855/7 "2012-08-21T22:51:04Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![tfp44](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/58956e/32.png) [@tfp44](https://www.ruby-forum.com/u/tfp44)\
**Post date:** [November 1, 2013, 11:59am UTC](https://www.ruby-forum.com/t/error-installing-therubyracer/219855/8 "2013-11-01T11:59:01Z")

</div>

Meck Z. wrote in post #1061376:

> Try this:
> 
> $ gem uninstall libv8  
> $ gem install therubyracer
> 
> It works for me.

Worked for me too.

---

<div class="post-metadata">

**Author:** ![tfp44](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/58956e/32.png) [@tfp44](https://www.ruby-forum.com/u/tfp44)\
**Post date:** [September 10, 2012, 10:44pm UTC](https://www.ruby-forum.com/t/error-installing-therubyracer/219855/9 "2012-09-10T22:44:07Z")

</div>

@johnrlive install git with homebrew rather than relying on the os x  
version.

---

<div class="post-metadata">

**Author:** ![tfp44](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/58956e/32.png) [@tfp44](https://www.ruby-forum.com/u/tfp44)\
**Post date:** [April 18, 2015, 6:52am UTC](https://www.ruby-forum.com/t/error-installing-therubyracer/219855/10 "2015-04-18T06:52:22Z")

</div>

There’s an official Omnibus package for the RPi2, see ‘Omnibus package  
for Raspberry Pi 2’ on [Download and install GitLab | GitLab](https://about.gitlab.com/installation/)
