I Mac

Mac OSX Snow Leopard | Archive of Problems

How to Install Ruby and Gem




Ruby is a language of careful balance. Its creator, Yukihiro “matz” Matsumoto, blended parts of his favorite languages (Perl, Smalltalk, Eiffel, Ada, and Lisp) to form a new language that balanced functional programming with imperative programming.
Since its public release in 1995, Ruby has drawn devoted coders worldwide. In 2006, Ruby achieved mass acceptance. With active user groups formed in the world’s major cities and Ruby-related conferences filled to capacity.

So, how to install ruby on mac ?



  1. Download Ruby source code here Download Ruby
  2. Extract Ruby with this command :
    $ tar -zxvf ruby-x.x.x.tar.gz
  3. Compile the source using this steps :
    $ cd ruby-x-x-x
    $ ./configure
    $ make
    $ sudo make install
  4. Make symbolic link into /usr/bin/ruby
    $ sudo ln -s /usr/local/ruby/bin/ruby /usr/bin/ruby
  5. Ruby was ready!


What is Ruby Gem?

A RubyGem is a software package, commonly called a “gem”. Gems contain a packaged Ruby application or library. The RubyGems software itself allows you to easily download, install, and manipulate gems on your system.

Each gem has a name, version, and platform. For example, therake gem has a 0.8.7 version. Rake’s platform is ruby, which means it works on any platform Ruby runs on. Other platforms include java (like nokogiri) and mswin32 (like sqlite-ruby).

Gems can be used to extend or modify functionality within a Ruby application. Commonly, they’re used to split out reusable functionality that others can use in their applications as well. Some gems also provide command line utilities to help automate tasks and speed up your work. As of Ruby 1.9.2, RubyGems is included when you install the programming language, so gems are both ubiquitous and extremely useful. If you’re using an earlier version of Ruby, it’s simple to install RubyGems as an addon.
Install Ruby Gem
  1. Download Ruby Gem here 
  2. Extract Ruby Gem source code :
    $ tar -zxvf rubygems-x.x.x.tgz
  3. Open the Ruby Gem extraction directory :
    $ cd rubygems-x.x.x
  4. Install the Ruby Gems :
    $ sudo ruby setup.rb


--------------Reference--------------


Responses

0 Respones to "How to Install Ruby and Gem"

Post a Comment

 

Recent Comments

Popular Posts

Return to top of page Copyright © 2010 | Platinum Theme Converted into Blogger Template by HackTutors