Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failing to install ruby gem "yajl-ruby"

I am trying to install the ruby gem "yajl ruby". I'm running Mac OS 10.7.4 and Ruby 1.8.7 (2011-12-28 patchlevel 357) [universal-darwin11.0]. When I run:

sudo gem install yajl-ruby

I get the following output:

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

        /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
creating Makefile

make
gcc -I. -    I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0     -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0     -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -arch i386 -arch x86_64 -g -Os -pipe -    fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common  -Wall -funroll-loops  -c yajl.c
make: gcc: No such file or directory
make: *** [yajl.o] Error 1


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/yajl-ruby-1.1.0 for     inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/yajl-ruby-1.1.0/ext/yajl/gem_make.out

What do I need to do in order to make the install work?

like image 509
histelheim Avatar asked Jan 17 '26 20:01

histelheim


1 Answers

Try this:

$ sudo ln -s /usr/bin/llvm-gcc /usr/bin/gcc-4.2

like image 166
lun Avatar answered Jan 19 '26 20:01

lun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!