Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute:

There are many people with similar issues and I've been one of them in the past on other machines and none of the solutions out there appear to work -- I also appear to have different error than others who have similar problems:

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

    /Users/username/.rvm/rubies/ruby-2.0.0-p353/bin/ruby -r ./siteconf20150412-25981-y7cvt6.rb extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
clang: warning: argument unused during compilation: '-rdynamic'
In file included from
In file included from ./rr.h:6:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/vector:265:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__bit_reference:15:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/algorithm:628:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:604:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iterator:341:10: fatal error: '__debug' file not found
#include <__debug>
1 error generated.
make: *** [accessor.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/ecnalyr/.rvm/gems/ruby-2.0.0-p353@canopy/gems/therubyracer-0.12.2 for inspection.
Results logged to /Users/ecnalyr/.rvm/gems/ruby-2.0.0-p353@canopy/extensions/x86_64-darwin-14/2.0.0/therubyracer-0.12.2/gem_make.out

When running:

gem install therubyracer -v '0.12.2'

or simply

bundle install

with therubyracer included in my gemfile.

I'm running Yosemite 10.10.3, Ruby 2.0.0-p353, I have uninstalled everything and tried the gem install libv8 -- --with-system-v8 solution that comes up frequently with these kind of problems, but have found no resolution.

share|improve this question

2 Answers 2

up vote 6 down vote accepted

I was able to solve this by re-installing Command Line Tools for XCode 6.2 (instead of those for XCode 6.3).

There's more discussion in Stack Overflow 29529455.

share|improve this answer
how did u uninstall 6.3 and install 6.2 – prasad.surase Apr 13 at 13:10
You don't need to, at least I didn't. – Gustavo Lobo Apr 13 at 15:36

Creating a temporary file '__debug' solved this issue for me.

Run this command in terminal:

echo '#define _LIBCPP_ASSERT(x, m) ((void)0)' | sudo tee -a /Library/Developer/CommandLineTools/usr/include/c++/v1/__debug > /dev/null

share|improve this answer
None of the other solutions help. This one solved it! Thanks – Kemo Apr 18 at 23:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.