These are some quick notes on getting set up to use Rails on \FreeBSD.  I presume you know how to install Apache and your database of choice from the ports tree.  For more information on \FreeBSD ports and packages, please refer to the "\FreeBSD Handbook.":http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports.html

Installing Ruby and Rails on \FreeBSD:


<b>Ports Method:</b>

Remember to update your ports tree before proceeding, if you haven't already done so.

* Install RubyGems using the ruby-gems port:
<pre>
  # cd /usr/ports/devel/ruby-gems
  # make install
</pre>

Note: This will automatically install Ruby if you don't already have it installed.

* Install Ruby Iconv support using the ruby-iconv port (*Required for Rails >= 0.11.0!*):
<pre>
  # cd /usr/ports/converters/ruby-iconv
  # make install
</pre>

* Install Ruby FastCGI support using the ruby-fcgi port:
<pre>
  # cd /usr/ports/www/ruby-fcgi
  # make install
</pre>

* Install Rails using RubyGems:
<pre>
  # /usr/local/bin/gem install rails
     (accept required dependencies)
</pre>

Rails includes the necessary database bindings.  You can find additional Ruby database bindings in /usr/ports/databases/.

Congratulations, you're ready to run Rails on \FreeBSD!

<b>Pre-compiled Package Method:</b>

The following command will download and install RubyGems from a remote server (as well as any required dependencies).  Note: Depending on your \FreeBSD release, this may not work, or may install an old version of RubyGems.
<pre>
  # pkg_add -r ruby-gems
  # pkg_add -r ruby-iconv
  # pkg_add -r ruby-fcgi
  # /usr/local/bin/gem install rails
     (accept required dependencies)
</pre>
(_On some systems you need packages like ruby18-gems, ruby18-iconv and ruby18-fcgi_)

*Credits:*

* RickBradley
* MichaelSchubert
