Ruby Gem Install Json Fails on Mavericks and Xcode 5.1 - Unknown Argument: '-Multiply_Definedsuppress'

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.

Cannot install pushmeup plugin

Apparently Apple broke something on Mavericks, they removed the warning flag unused-command-line-argument-hard-error-in-future acording to this issue: #528

Please try this command:

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

what it does? this sets the environment variable: ARCHFLAGS= this adds a ignore warnings -Wno-error= and this is the warning that you don't see in mavericks unused-command-line-argument-hard-error-in-future (which should be ignored)

In Apple documentation:

Compiler

As of Apple LLVM compiler version 5.1 (clang-502) and later, the
optimization level -O4 no longer implies link time optimization (LTO).
In order to build with LTO explicitly use the -flto option in addition
to the optimization level flag. (15633276) 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

Note: This option will not be supported in the future. To workaround
this issue, set the ARCHFLAGS environment variable to downgrade the
error to a warning. For example, you can install a Python native
extension with:

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

Similarly, you can install a Ruby Gem with:

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

EDIT HISTORY

just tested on my machine, using same ruby:

$ gem install pushmeup
Fetching: pushmeup-0.1.2.gem (100%)
Successfully installed pushmeup-0.1.2
Parsing documentation for pushmeup-0.1.2
Installing ri documentation for pushmeup-0.1.2
Done installing documentation for pushmeup after 1 seconds
1 gem installed

From what i saw you are not using rvm or rbenv so the problem is not in gcc dependencies

Accordingly to the output provided, the error was when installing json-1.8.1.
Can you post the log located at: /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/json-1.8.1/gem_make.out ?

Failed to build gem native extension error when installing mysql2 on mac

The error message says, `clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]. It seems that the option '-multiply_definedsuppress' is not currently accepted as an option by your compiler when installing it. You need to make your compiler accept it for the time being.

According to 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

Therefore, you may want to try running:

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

Clang build error when trying to install Jekyll

I used ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future bundle install
to treat the error as a warning.

Can't install mysql gem on OS X

From Apple's Xcode/Clang 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

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

Install Calabash-Android causes error on OS X Mavericks

I had the same problem and I just found out a solution for this.

I found one related problem here:

http://techespanto.wordpress.com/2013/03/29/upgrade-ruby-version-on-mac-osx/

and it suggested I had to upgrade the ruby version on my machine. The first two commands in that link are not working, so I leave you here what I did:

Install the command line tools for mac with:

xcode-select --install

Install homebrew in your mac with:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Install rvm with:

\curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enable

List the latest ruby versions with:

rvm list known

Install the latest ruby version with:

rvm install ruby-<version>

(for me it was ruby-2.1-head)

And that's all. Hope it works for you as well!

Unable to gem install breakpoint on Mac

Apple recently pushed a breaking change to Xcode (Xcode 5.1) that, if you're using the version of Ruby that comes with your computer, will make it impossible to install any Ruby gems that need native extensions. While Breakpoint doesn't need any, Compass requires the JSON gem, which does.

There is a Compass Issue to track progress on the removal of direct dependence on the JSON gem and instead require multi_json exclusively.

In a Breakpoint Issue identical to this problem, I describe in detail what's going on and provide options on how to solve the issue.

sudo gem install jekyll -- failure -- clang error unknown argument

Same issue encountered in Ruby Gem install Json fails on Mavericks and Xcode 5.1 - unknown argument: '-multiply_definedsuppress'

I found the comments in this issue for the jekyll repo helpful:
https://github.com/jekyll/jekyll/issues/2125

If you're using rvm or rbenv you can checkout Ruby 2.1.1 and it should install smoothly.

Otherwise you can install with
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install jekyll

Hope this helps!



Related Topics



Leave a reply



Submit