0

I have both XCode and XCode CLI installed and I don't have any issues installing any other gems, but here's what happens when I try to install therubyracer:

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

    /Users/me/.rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
creating Makefile

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

When I do: g++ -v, here's what I see:

g++ -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~148/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~148/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

Solution:

What I ended up working for me is changing the entry in the Gemfile to gem 'therubyracer', '0.10.1'.

If I don't specify this version, then it attempts to install 0.10.2 and that version seems to have an issue.

EastsideDev
  • 6,257
  • 9
  • 59
  • 116
  • This SO question might help. http://stackoverflow.com/questions/10905820/gem-install-therubyracer-fails-on-mac-os-x-lion – Ken Mar 12 '13 at 21:09
  • I've seen this thread and it does not work. What I ended up working for me is changing the entry in the Gemfile to gem 'therubyracer', '0.10.1'. If I don't specify this version, then it attempts to install 0.10.2 and that version seems to have an issue. – EastsideDev Mar 12 '13 at 23:17

0 Answers0