Failed to install therubyracer on a clean install of Yosemite and a clean version of ruby

There are many people with similar problems, and I was one of them in the past on other machines, and none of the solutions work there - I also have a 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=" compiling accessor.cc clang: warning: argument unused during compilation: '-rdynamic' In file included from accessor.cc:1: 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 

At startup:

 gem install therubyracer -v '0.12.2' 

or simply

 bundle install 

with therubyracer included in my gemfile.

I run Yosemite 10.10.3, Ruby 2.0.0-p353, I uninstalled everything and tried the gem install libv8 -- --with-system-v8 , which often occurs with such problems, but could not find a resolution.

+6
source share
2 answers

I managed to solve this problem by reinstalling the Command Line Tools for Xcode 6.2 (instead of those for Xcode 6.3).

More discussions in Stack Overflow 29529455 .

+7
source

Creating a temporary file "__debug" solved this problem 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

+11
source

Source: https://habr.com/ru/post/985008/


All Articles