Sunday, February 4, 2007

Using Ruby Gems

You may want to add functionality to your application using Ruby Gems. A gem is a packaged Ruby application or library. A great introduction to Ruby Gems can be found here. Basically, Ruby Gems keep you from having to reinvent the wheel, by providing you with modular pieces of code that can be accessed from within your application's code. By default, some gems will come pre-installed with your hosting plan. Generally these are Rails-relevant gems (ActiveRecord, ActionMailer, etc.). To see a list of installed gems at any time, type “gem list --local” from an SSH window. To install new gems, issue the command “gem install ” (where is the name of the gem you wish to install). This command will first search your local machine for the specified gem, and if not found, will attempt to automatically download the gem from RubyForge, an online gem repository. Check RubyForge for a complete listing of available gems or check the link here for a more condensed listing. More installation options can be found by typing “gem install --help”. By default, gems will be installed to '/usr/lib/ruby/gems/1.8/gems/'.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home