5

I'm having a hard time installing any of the ruby gems I want to because of a problem with fast-stemmer. I've put the error I'm getting below.

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

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

make "DESTDIR=" clean

make "DESTDIR="
compiling porter.c
porter.c:359:27: warning: '&&' within '||' [-Wlogical-op-parentheses]
  if (a > 1 || a == 1 && !cvc(z, z->k - 1)) z->k--;
            ~~ ~~~~~~~^~~~~~~~~~~~~~~~~~~~
porter.c:359:27: note: place parentheses around the '&&' expression to silence this warning
  if (a > 1 || a == 1 && !cvc(z, z->k - 1)) z->k--;
                      ^
               (                          )
1 warning generated.
compiling porter_wrap.c
linking shared-object stemmer.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [stemmer.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/fast-stemmer-1.0.2 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/fast-stemmer-1.0.2/gem_make.out

Some things I've tried to resolve the problem include: updating ruby gems, updating rvm, using ruby 2.1.1, re-installing command line tools. I'm on Mavericks.

If anyone could help me out it'd be much appreciated!

scoob
  • 367
  • 2
  • 14
  • possible duplicate of [Ruby Gem install Json fails on Mavericks and Xcode 5.1 - unknown argument: '-multiply\_definedsuppress'](http://stackoverflow.com/questions/22352838/ruby-gem-install-json-fails-on-mavericks-and-xcode-5-1-unknown-argument-mul) – Nakilon Apr 20 '14 at 01:34

1 Answers1

8

So, it appears that the problem I was having was caused by updating the last xCode, which in turn updated clang to 5.1, which in turn has broken a lot of ruby gems that haven't updated to reflect breaking changes in clang 5.1. I found this all on the Cloudspace blog.

Their solution (for the moment -- the error says they will become hard errors in the future) is to put the following flag to get your compiler to ignore the issue:

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future

For example:

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install librarian-chef

or to bundle:

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future bundle install
scoob
  • 367
  • 2
  • 14
  • Excellent comment @Helen! Mark your own answer as the correct one please, since it is. :) – Per Lundberg Mar 30 '14 at 11:22
  • @PerLundberg thanks for reminding me! I tried when I first found the answer but I didn't have enough rep points to do it immediately – scoob Apr 01 '14 at 17:51