0

I'm trying to set up Rails on a new machine and encounter this error when trying to install Ruby 1.9.3.

$ rvm install 1.9.3 --with-gcc=clang
Checking requirements for osx.
Installing requirements for osx.
Updating system.....
Error running 'requirements_osx_brew_update_system ruby-1.9.3-p545',
showing last 15 lines of /Users/mitchelld/.rvm/log/1395835654_ruby-1.9.3-p545/update_system.log
https://github.com/mxcl/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.'
++ 1395835655.N /scripts/functions/logging : rvm_error()  1 > rvm_pretty_print stderr
++ 1395835655.N /scripts/functions/logging : rvm_pretty_print()  73 > case "${rvm_pretty_print_flag:=auto}" in
++ 1395835655.N /scripts/functions/logging : rvm_pretty_print()  78 > case "${TERM:-dumb}" in
++ 1395835655.N /scripts/functions/logging : rvm_pretty_print()  81 > case "$1" in
++ 1395835655.N /scripts/functions/logging : rvm_pretty_print()  11 > [[ -t 2 ]]
++ 1395835655.N /scripts/functions/logging : rvm_pretty_print()  11 > return 1
++ 1395835655.N /scripts/functions/logging : rvm_error()  45 > printf %b 'Failed to update Homebrew, follow instructions here:
https://github.com/mxcl/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.\n'
Failed to update Homebrew, follow instructions here:
https://github.com/mxcl/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.
++ 1395835655.N /scripts/functions/requirements/osx_brew : requirements_osx_brew_update_system()  3return 1
Requirements installation failed with status: 1.

I get this error when trying to install Rails on Ruby 2.0.0

$ sudo gem install rails
Password:
Building native extensions.  This could take a while...
ERROR:  Error installing rails:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for libkern/OSAtomic.h... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling atomic_reference.c
atomic_reference.c:57:59: warning: incompatible pointer types passing 'void **' to           parameter of type 'volatile int64_t *' (aka 'volatile long long *') [-Wincompatible-pointer-types]
if (OSAtomicCompareAndSwap64(expect_value, new_value, &DATA_PTR(self))) {
                                                      ^~~~~~~~~~~~~~~
/usr/include/libkern/OSAtomic.h:507:93: note: passing argument to parameter '__theValue' here
bool    OSAtomicCompareAndSwap64( int64_t __oldValue, int64_t __newValue, volatile int64_t *__theValue );
                                                                                        ^
1 warning generated.
linking shared-object atomic_reference.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: *** [atomic_reference.bundle] Error 1

make failed, exit code 2

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

I have already tried to unstall the Atomic gem and reinstall which I found was caused by XCode 5.1.

Dan Mitchell
  • 844
  • 2
  • 15
  • 34
  • 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:22

1 Answers1

0

As the error message says,

  • make sure brew update works before continuing
  • after that a plain rvm install 1.9.3 without additional flags should work
  • with RVM, don't use sudo with the gem command since it will use the system RubyGems
  • just gem install rails should also work now
  • if you like to use the system Ruby, it seems as there's a problem with it in Mavericks. You may find a solution here: New Rails Project: 'bundle install' can't install rails in gemfile
Community
  • 1
  • 1
Patrick Oscity
  • 53,604
  • 17
  • 144
  • 168