Installing Ruby on MAC Os X 10.8.2

Installing Ruby on Mac OS X 10.8.2

Just found this. I think this is what you need to do.

First, if you haven't already, download MacPorts and install it. Then run the following two commands:

sudo port selfupdate
sudo port install apple-gcc42

Too get real UNIX GCC. Then, to install 1.9.3 run:

CC=/opt/local/bin/gcc-apple-4.2 rvm install ruby-1.9.3-p194 --enable-shared --without-tk --without-tcl

Which tells rvm to install Ruby using UNIX GCC without Tk or Tcl which require X11 (left out of OSX 10.8). If you want things like readline support, OpenSSL, etc., check out the above linked gist.

Installing ruby 1.9.3 on Mac OSX 10.8.2

Try this to let rvm know which gcc to use:

CC=/usr/bin/gcc-4.2 rvm install 1.9.3 

Or, if you want to use the Homebrew-installed gcc:

CC=/usr/local/bin/gcc-4.2 rvm install 1.9.3

It depends on where the gcc-4.2 interpreter is.

Two alternatives:

rvm install 1.9.3 --with-gcc=clang

Or use ruby-build.

EDIT September 7, 2013: Another alternative that I'm liking quite a lot for installing Rubies is ruby-install. It's in the spirit of the same author's chruby. Simple and gets the job done well.

Installing nokogiri Mac OS X 10.8.2 XCode installed

After short research I find out what problem can be simply solved by creating symbolic link

sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2

works for me hope for you too

gem install nokogiri
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.

/Users/morozovm/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
checking for libxml/parser.h... *** extconf.rb failed ***

bash-3.2$ sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
Password:
bash-3.2$ gem install nokogiri
Building native extensions. This could take a while...
Successfully installed nokogiri-1.5.6
1 gem installed

Can't install ruby 1.8.7 on Mac 10.8 via RVM

Ok, I found the solution.

  1. Remove Xcode.
  2. From here I downloaded the package for Mountain Lion.
  3. Install downloaded osx-gcc-installer.
  4. Install Xcode (and command-line tools).

That is all.



Related Topics



Leave a reply



Submit