title: Error while installing Rails on OSX 10.9.2
body: <p>I m trying to install Rails on my Macbook but ive had no luck Ive tried everything</p>
  
  <p>-Homebrew
  -RVM
  -Jewelry box
   I read here that by installing xcode and then trying to install rails again it might work.... it might worked for someone else but me........ this is the error Im getting.....</p>
  
  <p>Thanks in advance.</p>
  
  <pre><code>    $ 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... *** extconf.rb failed ***
  Could not create Makefile due to some reason, probably lack of necessary
  libraries and/or headers.  Check the mkmf.log file for more details.  You may
  need configuration options.
  
  Provided configuration options:
      --with-opt-dir
      --without-opt-dir
      --with-opt-include
      --without-opt-include=${opt-dir}/include
      --with-opt-lib
      --without-opt-lib=${opt-dir}/lib
      --with-make-prog
      --without-make-prog
      --srcdir=.
      --curdir
      --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
      --with-atomic_reference-dir
      --without-atomic_reference-dir
      --with-atomic_reference-include
      --without-atomic_reference-include=${atomic_reference-dir}/include
      --with-atomic_reference-lib
      --without-atomic_reference-lib=${atomic_reference-dir}/
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:430:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
  You have to install development tools first.
      from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:545:in `block in try_compile'
      from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:498:in `with_werror'
      from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:545:in `try_compile'
      from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:1040:in `block in have_header'
      from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:891:in `block in checking_for'
      from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:336:in `block (2 levels) in postpone'
      from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:306:in `open'
      from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:336:in `block in postpone'
      from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:306:in `open'
      from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:332:in `postpone'
      from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:890:in `checking_for'
      from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:1039:in `have_header'
      from extconf.rb:17:in `&lt;main&gt;'
  
  
  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/gems/atomic-1.1.16/ext/gem_make.out
  $ rails --version
  Rails is not currently installed on this system. To get the latest version, simply type:
  
      $ sudo gem install rails
  
  You can then rerun your "rails" command.
  $ 
  </code></pre>
  
  <p>** UPDATE **  </p>
  
  <p>I installed the xcode command line developer tools successfully and then went ahead to try and install rails and it gave me a new error that goes like this.......</p>
  
  <pre><code>$ 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="
  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, &amp;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
  
  
  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/gems/atomic-1.1.16/ext/gem_make.out
  </code></pre>