New Gem Generator
→ using ‘rubyforge’
The New Gem Generator makes it very easy for you to upload your gems to RubyForge, thanks to the integration of the hoe
and rubyforge
gems, by Ryan Davis.
This page describes how to setup the rubyforge application (lowercase rubyforge = the application), create new RubyForge projects (uppercase RubyForge = the website for hosting gems and homepages), and releasing your gems and their future versions to RubyForge using rubyforge.
Get a RubyForge project.
RubyForge is a great site for uploading gems, as the default settings of all RubyGems users is to look for new gems there. You can run your own gem server, but here we’ll assume you’re uploading to RubyForge.
Additionally, you can host more than one gem on each project. The Magic Models project hosts several gems, each with different versions.
To host your gems you’ll need a Project. Apply for it asap as it takes a day or so for the RubyForge admins to accept and generate your project.
Note: the name of your project does not have to match the name of any of your gems.
Setup access to RubyForge
Your new gem will use the rubyforge app to upload your gem. So first we need to set it up.
$ sudo gem install rubyforge $ rubyforge setup $ mate ~/.rubyforge/user-config.yml
This creates a configuration folder .rubyforge
in your home folder (on Windows it is XXXXXX). The last line is to edit the config file.
The only two lines to set are your RubyForge username and password. Ignore the rest.
$ rubyforge config
This generates a file ~/.rubyforge/auto-config.yml
which will be mostly empty now, but one day will be full of projects and all the releases of different versions of gems. One day soon I hope.
Just like the website, all other operations require you to login first.
$ rubyforge login
If this fails, check your user-config.yml files for problems with your username/password.
Preparing for a new gem
When you first release a new gem, you need to perform one more step.
$ rubyforge login $ rubyforge names
This will return the name of your new Project, if you forgot it.
$ rubyforge create_package #project_name# #gem_name#
Alternately, if you can’t get this to work, you can create the new package via the website.
- Login to RubyForge
- Go to your project’s page
- Click on Files.
- Click on To create new release click here.
- Click on Create a new package.
- Go to the bottom of the page, to the form New Package Name.
- Enter a package name, without spaces, and generally in all lowercase letters.
- Click Create This Package
Now return to the console/terminal, and refresh your rubyforge config files using rubyforge config
.
Check that the new package has been successfully added to your local config files using rubyforge name
. The new package should appear in the list of package names.
You are now ready to release gems!
Dr Nic, 13th April 2007
Theme extended from Paul Battley