This article describes building a ruby port from source. If you want the binaries produced by this article, I have released them via this Rubyforge project.
If your ports tree is not already prepped, please begin by prepping your ports tree.There is a message that you may run out of memory without modifying login.conf. My login.conf was already modified. My login is a member of the staff group:
staff:\ :datasize-cur=1024M:\ :datasize-max=infinity:\ :maxproc-max=256:\ :maxproc-cur=128:\ :ignorenologin:\ :requirehome@:\ :tc=default:
We will be using the official OpenBSD port from CVS.We will start by installing the prerequisites as binaries because if you have a fast internet connection, it is faster than building the ports from src:
sudo su setenv PKG_PATH "ftp://ftp2.usa.openbsd.org/pub/OpenBSD/4.2/packages/i386" # or export PKG_PATH="ftp://ftp2.usa.openbsd.org/pub/OpenBSD/4.2/packages/i386" pkg_add libiconv gdbm tk-8.4.7p1 exit
Now lets update the ruby port from CVS HEAD and build it. I did this on December 31, 2007 and the snapshot of the source code to the port can be found here: ruby.tgz
export CVSROOTemail@example.com:/cvs # pls choose a mirror near you # setenv CVSROOT firstname.lastname@example.org:/cvs cd :/usr/ports/lang/ruby cvs up -rHEAD . make packageNow we can install it:
sudo su setenv PKG_PATH './:ftp://ftp2.usa.openbsd.org/pub/OpenBSD/4.2/packages/i386' # or: export PKG_PATH='./:ftp://ftp2.usa.openbsd.org/pub/OpenBSD/4.2/packages/i386' cd /usr/packages/i386/all pkg_add ruby-184.108.40.206 # Or, of you already have ruby installed, try: pkg_add -r ruby-220.127.116.11And for a bonus, lets install Ruby-On-Rails:
pkg_add ruby-gems ruby-iconv-18.104.22.168 mysql-server mysql-client # Update gems to version 1.0.1, apparently needed for rails 2.0.2 but will break things like ruby-openid-1.1.4 gem update --system gem install rails # For Rails 1.2.6 # gem install -v 1.2.6 rails # Now let's optimize ruby for mysql gem install mysql # finally, mongrel rocks gem install mongrel --include-dependencies gem install mongrel_cluster
If this is a new MySQL install, don’t forget to follow the instructions in /usr/local/share/doc/mysql/README.OpenBSD.