Installing ruby 1.9 on Mac OS X 10.7 I'm trying to install Kitabu on Mac OS X 10.7.4.

When I tried to use gem install kitabu --pre to install kitabu, I got an error  

ERROR:  Error installing kitabu:
        kitabu requires Ruby version ~&gt; 1.9.


And the preinstalled ruby is not version 1.9.

ruby -v
ruby 1.8.7 (2011-12-28 patchlevel 357) [universal-darwin11.0]


Can I update preinstalled ruby to 1.9? If that's not possible, how can I install ruby 1.9 so that I can run it when gem is executed?
No don't update the Apple supplied ruby as that could affect existing ruby scripts and will get overridden in a System Upgrade.

To install ruby see the Download Ruby page from the ruby language website (the main page of which you should have bookmarked)

The two ways that you should consider are


Download the RVM. Then edit your .bash_profile to put the bin path
of the install at the front of your PATH.
Use a package manager (e.g. Macports, Fink, Homebrew) and put their
path at the front of your PATH ( I would use this only if you have C   libraries that you need as well)