In a Rubygems enabled environment, it's recommended to export RUBYOPT=rubygems to automatically require rubygems. A typical rubygem port looks like this: name=activerecord version=1.11.1 release=1 source=(http://rubyforge.org/frs/download.php/5163/activerecord-1.11.1.gem) GEMS_KEEP_DOC=yes . /usr/share/rubygems/Pkgfile.template The build() function comes from the template. Omit the GEMS_KEEP_DOC var if you don't want any rdoc documentation