Archive for January, 2011

Installing Ruby 1.9.2 on FreeBSD

06 Jan

I’m new to FreeBSD and I’m really loving it. As a Ruby developer here’s how to get started with FreeBSD.

Some things you might need, before you install Ruby
FreeBSD comes with csh by default, which is fun but its a bit cryptic. You might want to simply use the bash shell. The following installations may take a long time to complete because we are building everything from source.

To Build and install Bash

# whereis bash
bash: /usr/ports/shells/bash
# cd /usr/ports/shells/bash
# make install clean

To use bash, type:

# /usr/local/bin/bash

To make bash the default shell:

# chsh -s /usr/local/bin/bash {username}
# chsh -s /usr/local/bin/bash obi

To Build and Install wget

# whereis wget
wget: /usr/ports/ftp/wget 
# cd /usr/ports/ftp/wget
# make install clean

To Build and install python
We will need Python to build Git later.

# whereis python
python: /usr/ports/lang/python
# cd /usr/ports/lang/python
# make install clean

To Build and install Git
Git source mirror.

# wget
# tar xzf git-
# cd git-
# ./configure
# gmake
# gmake install
#git version
git version

To Build and install Ruby 1.9.2

# wget
# tar xzvf ruby-1.9.2-p136.tar.gz
# cd ruby-1.9.2-p136
# ./configure
# make install
# ruby -v
ruby 1.9.2p136 (2010-12-25 revision 30365) [i386-freebsd8.1]
# gem -v
# irb -v
irb 0.9.6(09/06/30)

We are all set. We now have the same Ruby environment on BSD as we use on Linux. I used this setup to test Ragios on FreeBSD. Bundler installed all the required gems with no problems.

If I missed something something in this write-up, please let me know in the comments.
Happy New Year!

Premium Wordpress Plugin