Just so that there’s at least one happy ending on this extended thread,
I’d like to report that I now have Readline, Ruby, Rubygems, Rails,
PCRE, Lighttpd, FastCGI with the Ruby FastCGI bindings, and MySQL with
the Ruby MYSQL native bindings, all installed and running on a clean
reinstallation of Tiger, with current Apple software updates and Xcode
2.1. (Also OSXvnc, which let me drive this from a wireless laptop, and
TextMate.)
Thanks to Ezra for motivating to start again on all this, with his
advice on the list and at
http://brainspl.at/pages/rails_stack
Thanks to Ryan R., who emailed me the recipe he uses for building the
contents of Locomotive, and continued to give advice by email.
Thanks to Dan Benjamin, the narrator of the HiveLogic Narrative, who has
just published full and up to date guidance on building the stack I
outlined above, at
Dan Benjamin
I found this when I ran into a couple of problems following Ezra’s
instructions (I’ve emailed Ezra the details - principally, it looks as
if Ezra’s instructions expect readline and OpenSSL to be installed
already).
Dan’s instructions overlap very substantially with Ezra’s, and I ended
up following them (I flagged some minor points to Dan, and he has
updated the article already). I got everything built and installed
yesterday, ready to test.
This morning it took very little time to show Rails running on Lighttpd,
and then to include MySQL in the combination (this is a “smoke test”
based on Ryan’s Locomotive movie,
http://locomotive.sourceforge.net/images/locomotive_intro.mov
which gives a nice Rails demo in 3 minutes 48 seconds… here I’m doing
the bare minimum to show that all the bits are present and talking to
one another):
(New shell, in home directory)
$ mkdir rails
$ cd rails
$ rails test
$ cd test
$ mate .
(this opens TextMate on the whole Rails project)
(In a separate shell, in home directory)
$ cd rails/test
$ script/server
(the output tells me that lighttpd is being used, and doing ps -ax in
another shell shows me that there’s a process running ruby, executing
public/dispatch.fcgi)
Browse
http://localhost:3000/
and see the Congratulations page.
(Back in the first shell)
$ script/generate controller say hello
Browse http://localhost:3000/say/hello
OK - this shows Lighttpd and Rails are working.
Looks at the logs - all looks fine.
Create db/monkeys.sql :
drop table if exists monkeys;
create table monkeys (
id int not null auto_increment primary key,
name varchar (100) not null
);
$ /usr/local/mysql/bin/mysql test -u root -p < db/monkeys.sql
(use the given empty test database…
TODO: add /usr/local/mysql/bin to my PATH
give root a password
create another user for rails apps)
In config/database.yml :
development:
adapter: mysql
database: test
username: root
password:
socket: /tmp/mysql.sock
Restart the server (Ctrl-C and script/server in the other shell)
$ script/generate scaffold Monkey
(server shell shows:
Monkey Columns (0.014769) SHOW FIELDS FROM monkeys
…see the same in development.log)
Browse http://localhost:3000/monkeys/list
It all works!
Thanks also to Jeroen H., for starting the thread and for giving
advice about reinstalling the iLife apps on my clean install of the
Tiger upgrade (and thanks to Trevor S. for warning me I would be
losing them). Finally, thanks to all the other posters for giving advice
about other options.
Justin