BT

RubyGems Roundup: 1.2 Release, JRuby, Faster Gem Releases

by Werner Schuster on Jun 28, 2008 |
Eric Hodel (watch InfoQ's interview with Eric) has released RubyGems 1.2. The release notes list a few new features:
  • RubyGems no longer performs bulk updates and instead only fetches the gemspec files it needs. Alternate sources will need to upgrade to RubyGems 1.2 to allow RubyGems to take advantage of the new metadata updater. If a pre 1.2 remote source is in the sources list, RubyGems will revert to the bulk update code for compatibility.
  • RubyGems now has runtime and development dependency types. Use #add_development_dependency and #add_runtime_dependency. All typeless dependencies are considered to be runtime dependencies.
  • RubyGems will now require rubygems/defaults/operating_system.rb and rubygems/defaults/#{RBX_ENGINE}.rb if they exist. This allows packagers and ruby implementers to add custom behavior to RubyGems via these files. (If the RubyGems API is insufficient, please suggest improvements via the RubyGems list.)
  • /etc/gemrc (and windows equivalent) for global settings
  • setup.rb now handles‚--vendor and‚--destdir for packagers
  • gem stale command that lists gems by last access time
To update from a recent version of RubyGems (at least 0.8.5), the release notes give this command:
$ gem update --system   (you might need to be admin/root) 
Installing Gems from GitHub is easier with RubyGems 1.2, as the GitHub blog notes:
Do yourself a favor and run the following commands if you're a Ruby guy/gal.
$ sudo gem update --system 
$ gem sources -a http://gems.github.com
You're now able to install gems from GitHub directly without specifying the source, just like you would if you were installing them from RubyForge.

Users of JRuby currently need to do a bit more work to get to use RubyGems 1.2. Vladimir Sizikov provides a workaround to get RubyGems 1.2 to run on current JRuby 1.1.x releases:
jruby -S gem update --system
this standard command to upgrade the rubygems just doesn't work with JRuby 1.1.2, due to bug in rubygems 1.1.1. Luckily, there is a workaround:
jruby -S gem install rubygems-update -v 1.1.1
Once this update is installed, then proceed with the main update command listed above.
This is just the first step - Vladimir's mail continues with the full explanation of which steps to follow or files to download to get RubyGems 1.2 to work.
Note: if you want to avoid following these steps, simply wait for JRuby 1.1.3, which will ship with RubyGems 1.2. A quick look at the Ruby 1.9 Changelog shows the trunk version of 1.9.x was upgraded to 1.2 as well.

Finally, Tom Copeland announces an improvement of RubyForge's Gems infrastructure:
The idea was that the filenames of new gems will be tracked and RubyForge will serve those gems locally rather than redirecting the request out to the mirrors. [..] The gem is being served without waiting for all the mirrors to be updated. Now I just need to write a little code to remove file names from the list after 24 hours or so; by that time the gem will have been sync'd out.
So, to summarize, gems will now be available very soon after they're released.

Hello stranger!

You need to Register an InfoQ account or to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT