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.
- Remove Xcode.
- From here I downloaded the package for Mountain Lion.
- Install downloaded osx-gcc-installer.
- Install Xcode (and command-line tools).
That is all.
Related Topics
What to Use Instead of 'Render :Text' (And 'Render Nothing: True') in Rails 5.1 and Later
How to Require Active Record Working Outside of Rails
Ruby 1.9 Hash with a Dash in a Key
Irb History Not Working with Ruby 2.3.0
Can You Eval Code in the Context of a Caller in Ruby
Unexpected Output in Ruby on Rails
Ruby: How to Iterate Over a Range, But in Set Increments
Bundler Cannot Install Any Gems Without Sudo
Install Rails 3 on Osx with Rvm
Unexpected Return (Localjumperror)
Where to Put Ruby Helper Methods for Rails Controllers
Size, Length and Count in Rails
Set Attribute Dynamically of Ruby Object
When Would a Ruby Flip-Flop Be Useful
Has_Many :Through with Counter_Cache
How to Reverse a 'Rails Generate'