Lots of problems installing on OSX

On 12/2/05, Justin F. [email protected] wrote:

Thanks. I think I’ll scrap my attempt at using DarwinPorts, reinstall
Tiger on my Mac Mini, and build everything from source as you advise.

What problems have you been having with using DarwinPorts?

I just completed a clean install using DarwinPorts, and had some
problems but got most of the quirks worked out.


Chris B.

http://hypsometry.com/ : website edification
http://uvlist.org/ : free classifieds for the Upper Valley

Thanks Justin,

I originally started this thread and it seems I’m not alone. So your
final conclusion is Lokomotive for development and no real solution for
production use (yet) right?

I still need to do a reinstall of my Mini. Do you know anything about
the Xcode tools from the Apple site? I was told they’re no good and you
need to use the ones included on the CD.

I find all of this frustrating too. I’m not a sysadmin nor do I want to
be. I just want design and code. Okay I need some basic understanding of
how things work, fine, but I don’t want to be patching bogus Ruby
installs or comparing dozens of different possible solutions. Anywas,
I’m not blaming anybody here (or maybe Apple for putting a lame Ruby
install on their system).

Cheers,

Jeroen

Jeroen H. wrote:

Thanks Justin,

I originally started this thread and it seems I’m not alone. So your
final conclusion is Lokomotive for development and no real solution for
production use (yet) right?

That’s today’s situation - maybe things will be better after the
weekend!

Given that Locomotive contains so much stuff, it would be good to also
look at options for pulling out Locomotive content into a permanent
installation… I might email Ryan R. about the possibility. But this
weekend I’ll just be starting afresh and following Ezra’s instructions.
If I can get lighttpd-fastCGI-Rails-MySQL running, and make that visible
through my firewall, that will be great.

I still need to do a reinstall of my Mini. Do you know anything about
the Xcode tools from the Apple site? I was told they’re no good and you
need to use the ones included on the CD.

This note has recently been added to

Peak Obsession

and supports what you have heard (but gives a fix):

With 10.4.3 and Xcode 2.2 (November 10, 2005), several file locations have changed. Native extensions won?t build; you can fix this by adding symlinks to the old locations. sudo ln -s /usr/lib/ruby/1.8/universal-darwin8.0/* /usr/lib/ruby/1.8/powerpc-darwin8.0

So I think I’ll get ruby, gems, rails, fastCGI and database drivers
sorted out before I bring Xcode up to date.

I find all of this frustrating too. I’m not a sysadmin nor do I want to
be. I just want design and code. Okay I need some basic understanding of
how things work, fine, but I don’t want to be patching bogus Ruby
installs or comparing dozens of different possible solutions.

Exactly.

Anywas,

I’m not blaming anybody here (or maybe Apple for putting a lame Ruby
install on their system).

Well, I was hoping to use the fixrbconfig gem to sort that out, but then
found that the DarwinPorts install of gems brought a whole new Ruby
along with it…

Oh well. Think I’ll burn a CD of everything I had downloaded, and then
start reinstalling.

regards

Justin

Chris B. wrote:

The specific problem I had with DarwinPorts was that the rb-rubygems
installation failed, with an error that someone else had reported in
Bugzilla but which had been closed because the maintainer had failed to
reproduce it. (bug 4137 at http://bugzilla.opendarwin.org/)

I managed to get past this by following some advice associated with that
bug. Then I had problems with path setup, given that the gems port had
insisted on installing the ruby port, so I now had two installations of
ruby.

But the fundamental problem I have had with getting Rails up and running
in anything approaching production form on OS X (I am entirely happy
with Locomotive + TextMate for development) is that there is no
definitive source of dependable, up to date guidance. (This seems
particularly strange given that DHH once blogged that he’d have doubts
about hiring anybody who wasn’t using a Mac.) The Wiki is a mess, and
there are many alternative sources, all different. Here’s the list of
URLs I was comparing at the time:

http://wiki.rubyonrails.com/rails/pages/HowtoInstallOnOSXTiger

http://wiki.rubyonrails.com/rails/pages/FastCGI+on+OS+X
http://maczealots.com/tutorials/ruby-on-rails/
http://www.tonyarnold.com/articles/2005/08/10/rolling-with-ruby-on-rails-on-mac-os-x-tiger-for-beginners
http://wiki.rubyonrails.org/rails/pages/HowtoInstallOnOSXTigerUsingDarwinPorts
http://www.pjhyett.com/articles/2005/06/04/setting-up-ror-in-tiger
http://theexciter.com/articles/installing-lighttpd-on-osx
http://tech.rufy.com/entry/46

http://mongoo.se/articles/2005/10/28/fresh-install-of-rails-on-tiger#comments

Then, once all the pieces seem to have installed correctly, there are
the problems of configuration and integration testing. I don’t think any
of the articles I’ve read gives advice on how to test that each piece is
working before putting everything together, or on how to diagnose
problems. This is not specific to OS X, and even the AWDR book is
lacking in this respect.

I have an iBook where I used one approach to installation (using Tony
Arnold’s package) and a Mac Mini where I have been trying to use
DarwinPorts, and in neither case have I reached a point where
Apache/fastCGI/Rails is working. I would like to gain mastery of:

Apache-fastCGI-Rails
lighttpd-fastCGI-Rails
Apache-lighttpd-fastCGI-Rails

with multiple applications, either discriminated by domain name, or
port, or path,

with SQLite or MySQL or PostgreSQL

and I can see it taking a long time (this is a spare-time activity).

I did once (back in April) succeed in getting Apache-fastCGI-Rails-MySQL
working on Windows XP.

Sorry for the long response, but I find this extremely frustrating

Justin

Justin F. wrote:

Ezra Z. wrote:

The php part is only there if you need to run php apps under lighttpd/
fcgi. I like to run phpmyadmin out of the public dir of my rails app
sometimes. You don’t need that part unless you need php.

Thanks. I think I’ll scrap my attempt at using DarwinPorts, reinstall
Tiger on my Mac Mini, and build everything from source as you advise.

I use Fink myself and it works, so you may want to give that a shot
also.

Regards,
Blair


Blair Z., Ph.D.
[email protected]
Subversion and Orca training and consulting
http://www.orcaware.com/svn/

Guys-

I know i already posted this link to you but i want to let you know

that I have used these exact instructions to set up over 20 OSX
systems that now run the whole stack perfectly. I gave up on apache/
fcgi after much testing and went with lighttpd/fcgi for my rails
apps. I still use apache sometimes but just as a front proxy to
lighttpd on a higher port so that I can serve multiple rails apps
with different addresses off of port 80. Here is the link again to
the install set up:

http://brainspl.at/pages/rails_stack

And here is an example apache vhost to use to proxy your rails apps
from apache on port 80 to lighttpd on a higher port:

<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
ProxyPass / http://example.com:8000/
ProxyPassReverse / http://example.com:8000/

I used these same instructions to install the whole rails/lighttpd

stack on a dual g5 xserve that serves http://yakimaherald.com . That
site gets 70,000+ page views/day and has been running great ever
since launch in August. I know there are many different versions of
tutorials so I took some from all of them and made those instructions
which have worked very well for me many times. So I hope this helps
you get some perspective. I highly recommend just ignoring apache/
fcgi and just using lighttpd for your fcgi needs. Apache/fcgi was
never stable for me on OSX no matter what I did. lighttpd/fcgi is
rock solid for me on OSX and has been for the better part of my last
year on rails.

Feel free to contact me off list if you run into trouble or want

some good lighttpd.conf files for your apps and i will do my best to
help you get off the ground. Once you get a good install once you
will be able to repeat it easily on other machines.

Cheers-
-Ezra\

On Dec 2, 2005, at 9:31 AM, Jeroen H. wrote:

I find all of this frustrating too. I’m not a sysadmin nor do I
Justin F. wrote:

What problems have you been having with using DarwinPorts?
with that bug. Then I had problems with path setup, given that the
Peak Obsession
http://scottstuff.net/blog/articles/2005/07/20/apache-tuning-for-
use DarwinPorts, and in neither case have I reached a point where
Sorry for the long response, but I find this extremely frustrating


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

-Ezra Z.
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
[email protected]

Blair Z. wrote:

Thanks. For this installation of Rails, I’m going to build from source
as Ezra advised, but I will take a look at Fink out of more general
interest. I’ve been a bit puzzled as to why people are seeming to prefer
DarwinPorts these days, when Fink installs binaries.

regards

Justin

Ezra Z. wrote:

http://brainspl.at/pages/rails_stack

Thanks, Ezra. I’ve been constantly impressed at your experience and at
the amount and quality of advice you give on the list.

I’ve backed up my Mac Mini and taken the “Erase and Install” option on
the Tiger upgrade DVD - once that’s complete I’ll install Xcode and then
proceed through your instructions.

and has been for the better part of my last year on rails.
Fine - I’ll drop the Apache/fcgi option off my list, get lighttpd/fcgi
running on port 80, and evaluate the apache proxy option for future use.

Feel free to contact me off list if you run into trouble or want  

some good lighttpd.conf files for your apps and i will do my best to
help you get off the ground. Once you get a good install once you will
be able to repeat it easily on other machines.

Thank you very much

Justin

On 2-Dec-05, at 12:15 PM, Justin F. wrote:

I’ve backed up my Mac Mini and taken the “Erase and Install” option
on the Tiger upgrade DVD - once that’s complete I’ll install Xcode
and then proceed through your instructions.

Hey Justin,

careful with that - I did the same thing and found that my bundled
iLife software was no-longer available. My panther install media
wouldn’t install the bundled tools onto the fresh Tiger install. I
tried (some third-party package unpacking/installing tool that I
can’t remember the name of) but it didn’t help.

In the end I did a fresh panther install immediately followed by a
tiger simple upgrade (no archive).

HTH,
Trevor

Justin F. wrote:

Regards,
Blair

Thanks. For this installation of Rails, I’m going to build from source
as Ezra advised, but I will take a look at Fink out of more general
interest. I’ve been a bit puzzled as to why people are seeming to prefer
DarwinPorts these days, when Fink installs binaries.

Well, Fink didn’t support Ruby on Rails until I put in a large amount of
effort
into bring it up to date, including Ruby (up from 1.8.1), rubygems,
sqlite and
sqlite3. So I believe that the popularity of DarwinPorts is due to its
earlier
support of Rails.

BTW, currently, there aren’t binaries available for Fink, as the Fink
team
hasn’t done a binary release for a while. So, I’m thinking of having
the debs I
compile publicly available so that people can use them via
/sw/etc/apt/sources.list.

Regards,
Blair


Blair Z., Ph.D.
[email protected]
Subversion and Orca training and consulting
http://www.orcaware.com/svn/

On Dec 2, 2005, at 10:16 AM, Justin F. wrote:

and supports what you have heard (but gives a fix):

With 10.4.3 and Xcode 2.2 (November 10, 2005), several file locations have changed. Native extensions won?t build; you can fix this by adding symlinks to the old locations. sudo ln -s /usr/lib/ruby/1.8/universal-darwin8.0/* /usr/lib/ruby/ 1.8/powerpc-darwin8.0

That was my experience, too. I didn’t dig into very far, though – I
had Rails working on two other Macs with Tiger + rbfixconfig, so I
just uninstalled the 2.2 tools and replaced them with developer tools
package on the Tiger CD.

Semi-related: I’d vote for compiling Ruby yourself over trying to
patch Apple’s version or Darwin Ports or Fink. (Be careful that your
PATH points to the new install, of course). Both Fink and Darwin
Ports are great for *nix libraries that you may want. GTK for Ruby-
Gnome2, say. But they’re a bit much if all you need is the typical
Rails stack.

Scott_______________________________________________
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

Trevor S. wrote:

careful with that - I did the same thing and found that my bundled
iLife software was no-longer available. My panther install media
wouldn’t install the bundled tools onto the fresh Tiger install. I
tried (some third-party package unpacking/installing tool that I can’t
remember the name of) but it didn’t help.

In the end I did a fresh panther install immediately followed by a
tiger simple upgrade (no archive).

HTH,
Trevor

Trevor - thanks! It’s nice to have so many people watching over me :slight_smile:
You are right - I’ve lost the iLife apps.

For now, I’ll press on with the Xcode and Rails installs on a rather
bare Tiger, but once I’m confident with the Rails on OS X setup I’ll
back up everything to do with Rails, gems, and lighttpd etc, do the
Panther install and Tiger upgrade as you recommend, and then restore
Rails etc.

regards

Justin

Scott W. wrote:

This note has recently been added to
1.8/powerpc-darwin8.0
points to the new install, of course). Both Fink and Darwin Ports are
great for *nix libraries that you may want. GTK for Ruby- Gnome2, say.
But they’re a bit much if all you need is the typical Rails stack.

Thanks - I have come round to the same point of view.

Ryan R. emailed me about how it’s done in Locomotive, which is
largely based on DarwinPorts, and advised me to just put the new install
at the front of the PATH rather than doing anything to clobber Apple’s
version.

Interestingly, during the life of this thread (on 1st December) Dan
Benjamin, the author of the Hivelogic Narrative, has added specific and
up to date instructions for building and installing Ruby, Rails,
Lighttpd, FastCGI and MySQL on Tiger:

I found that when I ran into a problem following Ezra’s instructions,
and wanted to cross-check. It supersedes Dan’s earlier guidance on
setting up Ruby and Rails for FastCGI under Apache.

I started with Xcode 2.0, as supplied with Tiger. Dan says Xcode 2.1 is
preferable, so I downloaded that during the night, and have been
retracing my steps (and seeing that the same problems occur).

Will post a full account later.

regards

Justin

Jeroen H. wrote:

tiger simple upgrade (no archive).
You can also insert the panther 10.3 CD that came with your Mini and
select “Install Bundled Software only” - that way you won’t need to
install 10.3 first.

That’s great… I presumably need to restart to do that?
(I’m testing my new install now… must break to go shopping… will post
details later)

regards

Justin

Justin F. wrote:

Hey Justin,
HTH,
Trevor

Trevor - thanks! It’s nice to have so many people watching over me :slight_smile:
You are right - I’ve lost the iLife apps.

You can also insert the panther 10.3 CD that came with your Mini and
select “Install Bundled Software only” - that way you won’t need to
install 10.3 first.

Jeroen

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

Justin F. wrote:

Jeroen H. wrote:

[regarding getting the iLife apps back after a clean install of Tiger
from an original-version Mac Mini Tiger upgrade DVD]

You can also insert the panther 10.3 CD that came with your Mini and
select “Install Bundled Software only” - that way you won’t need to
install 10.3 first.

That’s great… I presumably need to restart to do that?

No restart was needed (strictly in line with what Jeroen wrote).

Justin