Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bcourtney5965/9849515 to your computer and use it in GitHub Desktop.
Save bcourtney5965/9849515 to your computer and use it in GitHub Desktop.
Rails installation difficulties, post XCode install
Last login: Fri Mar 28 22:56:53 on ttys000
Brandon-Courtneys-MacBook-Pro:~ brandoncourtney$
Brandon-Courtneys-MacBook-Pro:~ brandoncourtney$ rails new myproject
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.
Brandon-Courtneys-MacBook-Pro:~ brandoncourtney$ 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, &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
Brandon-Courtneys-MacBook-Pro:~ brandoncourtney$ gem install rails
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
Brandon-Courtneys-MacBook-Pro:~ brandoncourtney$
@massanen7
Copy link

The following steps worked for me:

Ran this on my command line like @rorra told me to (because of my earlier error)

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

Installed Homebrew

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

Installed ruby-build

brew install ruby-build

Add the your .bash_profile this line (this is to let rbenv know it has to initialize itself everytime you open a terminal shell)

eval "$(rbenv init -)"

Install Ruby Using rbenv

rbenv install (version of ruby you need)

Use this to rehash the Version manager:

rbenv rehash

Set the ruby version you want to use or the recently installed one

rbenv global (version number installed)

Install the gem Bundler then rehash by following step 6

gem install bundler

Install rails

gem install rail --no-ri --no-rdoc

source:
http://92.42.51.245.cancer.iwanslphotography.com/nph-p.cgi/20/http/stackoverflow.com/questions/22601715/i-get-this-error-while-i-try-to-install-rails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment