Monday, August 10, 2009

Building the Gem File

The MomLog gemspec we just created is runnable as a Ruby Program. Invoking it will create a gem file, MomLog-0.5.0.gem.

%ruby momlog.gemspec

Alternatively, you can use the gem build command to generate the gem file.

%gem build momlog.gemspec

Now that you've got a gem file, you can distribute it like any other package. You can put it on an FTP server or a Web site for download or e-mail it to your friends. Once your friends have got this file on their local computers (downloading from your FTP server if necessary), they can install the gem (assuming they have RubyGems installed too) by calling.

%gem install MomLog-0.5.0.gem

If you would like to release your gem to the Ruby community, the easiest way is to use RubyForge ( RubyForge is an open source project management Web site. It also hosts the central gem repository. Any gem files released using RubyForge's file release feature will be automatically picked up and added to the central gem repository several times each day. The advantage to the potential users of your software is that it will be available via RubyGems'remote query and installion operations, making installation even easier.

No comments:

Post a Comment