Ruby on Rails: A Newbie’s Journey, Part 3
April 2, 2008
So finally I settled on using Dan Benjamin (Hivelogic)’s method of installing Rails. This promised a set-up on Mac OSX (Tiger) of Ruby, Rails, Subversion (version control), Mongrel (web server) and MySQL (database). There were a couple of pre-requisites detailed that I needed to attend to first.
Firstly, I installed XCode 2.4.1 off the Mac DVD that came with my system. I didn’t do anything beyond complete the installation though. Next I read Dan’s comments on using the /usr/local path for software installs. Some of it flew past me a bit but he did enough to convince me this was the way to go, especially as it appeared his method wouldn’t work if I didn’t! After a couple of false starts I wanted to try and follow the route to the letter. The upshot with this is that Dan states to edit the .bash_login file by adding the following to the end:
export PATH=”/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH”
Great I thought, where the Dickens is that? The period at the start of the file name should be a clue as this means it is a hidden file. Turns out showing hidden files on a Mac is no straightforward task (well, not if you don’t know how to do it that is). Anyway, a quick trip to the net told me that the following script is needed (I set this up in Automater):
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
To hide them again you simply run a script as above but with FALSE instead of TRUE. So I did that but no sign of the .bash_login file. Nothing else for it then I just created one in Textedit with the export PATH command as above and saved this to my home folder (no file extension). Checking the permissions on the file, though, shows that I needed to create full read, write and execute permissions on the file (using chmod):
computer:~ user$ ls -l ~/.bash_login
-rw-rw-r– 1 user user 72 Mar 30 18:38 /Users/user/.bash_login
computer:~ user$ chmod 755 ~/.bash_login
computer:~ user$ ls -l ~/.bash_login
-rwxr-xr-x 1 user user 72 Mar 30 18:38 /Users/user/.bash_login
computer:~ user$
Executing the file just returns the command prompt as expected:
computer:~ user$ ~/.bash_login
computer:~ user$
So groundwork done, on to running the Rails environment install. The full instructions are on Dan’s site so I am not going to unnecessarily repeat them here; I will however point out how each bit went.
Setting Up
Followed this to the letter.
Ruby
Again, followed as instructed. Each step progressed without any errors. I did of course already have Ruby on my system but I still did the Ruby install part (installing 1.8.6 as expected).
RubyGems
As told, not a hitch.
Ruby on Rails
Again no errors, although did notice that Rails 2.0.2 installed (significantly as it turns out later…).
Mongrel
All went fine, selected Ruby version 1.1.4 when prompted.
Subversion
Installed this as instructed (version 1.4.3) although got a warning message in the Terminal:
configure: WARNING: we have configured without BDB filesystem support
You don’t seem to have Berkeley DB version 4.0.14 or newer
installed and linked to APR-UTIL. We have created Makefiles which
will build without the Berkeley DB back-end; your repositories will
use FSFS as the default back-end. You can find the latest version of
Berkeley DB here:
http://www.sleepycat.com/download/index.shtml
This didn’t appear to make any difference so I have ignored it for now (but will return to it later I guess).
Capistrano (and termios)
Both installed without a hitch.
MySQL
Obtained the Mac OS X 10.4 (x86) file from mysql.com (version 5.0.51a) and installed as instructed. I also started the server at this point. No problems were encountered.
MySQL Native Bindings Gem
Installed as instructed. I did notice that the latest Ruby version was higher than those listed on Dan’s site, so I selected this (didn’t note what it was though). No problems.
Fix MySQL
Did without a hitch.
And so that was that - everything seemed fine. Thanks Dan! There were a couple of things still not quite right but they only came to light when I tried to set up my first basic application. More on this in Part 4.
One Response to “Ruby on Rails: A Newbie’s Journey, Part 3”
Leave a Reply
You must be logged in to post a comment.


April 2, 2008 at 11:49 pm
[...] detail my experiences with Dan’s methods in Part 3. Posted by godflesh Filed in web design Tags: leopard, mac, osx, rails, ruby, [...]