Ruby Gem install Json fails on Mavericks and Xcode 5.1 – unknown argument: ‘-multiply_definedsuppress’

I am encountering the exact same problem after updating Xcode to 5.1 and news from Apple aren’t good. From Xcode 5.1 Release Notes:

  • The Apple LLVM compiler in Xcode 5.1 treats unrecognized command-line options as errors. This issue has been seen when building both Python native extensions and Ruby Gems, where some invalid compiler options are currently specified.

Projects using invalid compiler options will need to be changed to remove those options. To help ease that transition, the compiler will temporarily accept an option to downgrade the error to a warning:

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

To workaround this issue, set the ARCHFLAGS environment variable to downgrade the error to a warning.

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

It seems that all gems violating the compiler options must be updated to use valid options. It is explicitly stated that: This option [downgrading error to warning] will not be supported in the future.

The clang note we are seeing (this will be a hard error (cannot be downgraded to a warning) in the future) corresponds to the change announced in the release notes.


To answer your question specifically, use the following to install the json gem:

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

Note, however, that this is only a temporary fix.

Leave a Comment