Reputation: 2811
Just got a new macbook pro and im having troubles installing rails.. I got ruby 1.8.7 already installed and when i try to write 'gem install rails' i get:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.
I also tried to install a higher version of ruby and it said:
Nirs-MacBook-Pro:~ nirohayon$ rvm install 1.9.3
Fetching yaml-0.1.4.tar.gz to /Users/nirohayon/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/nirohayon/.rvm/src
Configuring yaml in /Users/nirohayon/.rvm/src/yaml-0.1.4.
Error running ' ./configure --prefix="/Users/nirohayon/.rvm/usr" ', please read /Users/nirohayon/.rvm/log/ruby-1.9.3-p125/yaml/configure.log
Compiling yaml in /Users/nirohayon/.rvm/src/yaml-0.1.4.
Error running 'make ', please read /Users/nirohayon/.rvm/log/ruby-1.9.3-p125/yaml/make.log
Database file /Users/nirohayon/.rvm/config/packages does not exist.
Installing Ruby from source to: /Users/nirohayon/.rvm/rubies/ruby-1.9.3-p125, this may take a while depending on your cpu(s)...
ruby-1.9.3-p125 - #fetching
ruby-1.9.3-p125 - #extracted to /Users/nirohayon/.rvm/src/ruby-1.9.3-p125 (already extracted)
ruby-1.9.3-p125 - #configuring
Error running ' ./configure --prefix=/Users/nirohayon/.rvm/rubies/ruby-1.9.3-p125 --enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/nirohayon/.rvm/usr ', please read /Users/nirohayon/.rvm/log/ruby-1.9.3-p125/configure.log
There has been an error while running configure. Halting the installation.
ls: /Users/nirohayon/.rvm/rubies/*/bin/ruby: No such file or directory
PLEASE help me, i used windows before and also pretty new to rails, so i dont know much about which path should i direct my terminal. i need a step by step explanation to put rails up and standing on my mac.
Thanks so much! Nir
Upvotes: 3
Views: 3560
Reputation: 11504
This tutorial helped me install on mac before with OS X 10.6 (I believe). The only thing that was a trouble was the C compiler, which I figured out was the problem from looking up one of the errors.
Probably you will find by looking up the output Error running 'make ', please read /Users/nirohayon/.rvm/log/ruby-1.9.3-p125/yaml/make.log
by typing vi /Users/nirohayon/.rvm/log/ruby-1.9.3-p125/yaml/make.log
type esc
key followed by typing :q!
to quit.
As previous answer suggested, you need to get a compiler. I don't know about Xcode specifics, but I tracked down an installer for GCC compiler for Mac on Github I believe but it is probably better straight from Apple packages, (tutorial here)
Also note that if you end up having to use sudo
at all, you've probably gone off-track from the guide to install RVM on your system. In which case your path will be somewhere other than in the home directory and the instruction to adjust your source with echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bash_profile
will not work. Which may end up being somewhere like "/usr/local/rvm/scripts/rvm"
Upvotes: 1
Reputation: 12829
Your use of RVM looks a lot like you don't have the developer tools installed. Grab XCode from the App Store, the install the command line tools!
If you really want to install rails on the platform-provided ruby, all you need to do is to sudo gem install rails
, for you need to use administrator privileges to isntall gems in the system gemset.
Upvotes: 2