Skip to content

Instantly share code, notes, and snippets.

@chrisroos
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisroos/cf79d1d9ecb0472adf01 to your computer and use it in GitHub Desktop.
Save chrisroos/cf79d1d9ecb0472adf01 to your computer and use it in GitHub Desktop.
The problem I had when installing gems under Ruby 2.1.5

I'm getting this error when installing eventmachine in one project, and therubyracer in another.

I tried re-installing Command Line Tools for XCode 6.3 but that didn't work.

I tried re-installing Ruby 2.1.5 but that didn't work.

Having re-read "Missing c++ header <__debug> after updating OSX Command Line Tools 6.3" I noticed that it said to reinstall the Command Line Tools for XCode 6.2. I've now done that and can successfully compile eventmachine and therubyracer gems.

Another Stack Overflow post, "Unable to install therubyracer on clean install of Yosemite and clean version of ruby", talks about the same problem but doesn't have an answer listed.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/chrisroos/.rbenv/versions/2.1.5/bin/ruby 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/chrisroos/Code/alphagov/smart-answers/.bundle/gems/gems/therubyracer-0.12.1 for inspection.
Results logged to /Users/chrisroos/Code/alphagov/smart-answers/.bundle/gems/extensions/x86_64-darwin-14/2.1.0-static/therubyracer-0.12.1/gem_make.out
An error occurred while installing therubyracer (0.12.1), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.12.1'` succeeds before bundling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment