Are you trying to install / run Rails 3.1 on a FreeBSD system...?
You will probably get errors of a missing javascript engine.
You should try to install node and google V8 as javascript engine
cd /usr/ports/lang/v8 make install clean
cd /usr/ports/www/node make install clean
Now it should work :-)
You are my hero! After days of trying to get therubyracer and associated files to compile on my freeBSD box, your post has offered the most elegant solution. And it works. Thanks again.
Installing Ruby 1.9.3 or 2.0.0 and Rails 3.2 on FreeBSD:
http://www.rubybb.com/bsdonrails.pdf
Hope it will help some people :)