gem won’t install Ruby gems on VPS…

July 28th, 2009 Posted in System administration | No Comments »

Having trouble installing Ruby gems on your VPS? Gem was hanging on my Slicehost slice (running Ubuntu Hardy with 256MB of RAM) at “Bulk updating [...]“:

$ gem update
Updating installed gems...
Bulk updating Gem source index for: http://gems.rubyforge.org

It was also gobbling up CPU and memory.

Why does gem hang?

The distro package for Gem is very old, and this old version uses a lot of memory, causing lots of disk thrashing. Since hard disks are, ahem, a bit slower than RAM, this increases gem’s run time by probably a few orders of magnitude.

Solution

Update gem manually:

$ wget http://rubyforge.org/frs/download.php/57642/rubygems-update-1.3.4.gem
$ sudo gem install rubygems-update-1.3.4.gem
$ sudo /var/lib/gems/1.8/bin/update_rubygems
Installing RubyGems 1.3.4
Installing RubyGems
Installing gem executable
Removing old source_cache files
Removing old RubyGems RDoc and ri
Installing rubygems-1.3.4 ri into /usr/lib/ruby/gems/1.8/doc/rubygems-1.3.4/ri
Installing rubygems-1.3.4 rdoc into /usr/lib/ruby/gems/1.8/doc/rubygems-1.3.4/rdoc

RubyGems installed the following executables:
/usr/bin/gem1.8

Looks like everything’s OK, but gem didn’t work anymore:

$ sudo gem install haml
/usr/bin/gem:10: undefined method `manage_gems' for Gem:Module (NoMethodError)

What gives? Notice the path, /usr/bin/gem. Is that still the old version?

$ ls -lah /usr/bin/gem*
-rwxr-xr-x 1 root root 701 Nov 19  2007 /usr/bin/gem
-rwxr-xr-x 1 root root 545 Jul 28 00:15 /usr/bin/gem1.8

Yes. This is what we get for upgrading gem without using Ubuntu’s package system. Well, in for a penny, in for a pound:

sudo mv /usr/bin/gem1.8 /usr/bin/gem

Done. Now to install Haml and Sass….

Bed frame for a Sleep Number bed

July 8th, 2009 Posted in Woodworking | No Comments »

I designed and built this bed frame for a Select Comfort Sleep Number queen bed. It uses 2×6s, 1×6s, 1×4s, and a lot of screws and brackets.

I was inspired by:

  • A bed frame at IKEA which housed useful drawers underneath—it was pretty but it cost $300 and was flimsy.
  • Lack of Sleep Number bed frame plans on the Internet—my eyes! The Googles do nothing!

My frame has a special area to house the bed’s noisy air pump. This gets the pump out of the way and quiets it significantly.

If you’re wondering why there are two pieces of wood per slat, it’s because the extra 1×4s I had lying around weren’t quite long enough. Sure glad I was able to make them useful!

Future work

Put in some nice drawers on wheels—I might buy the drawers from IKEA—and if the frame’s too short for them, add some legs and a bottom for the air pump compartment.