Monday, May 14, 2007

Configuring Trac on Mac OS X - One for the books

I needed to get Trac running locally on my Mac OS X box. There's some info over at the Trac site about it, but I had some extra complications that made my problem stranger. Things like this make me believe more in ProjectLocker, where we can at least save our customers from headaches like this.

Bad Python
I had MacPython installed in /Library/Frameworks/Python.framework. It modifies your .profile to put itself in front of your /usr/local/bin. This was confusing my ClearSilver installation among other things and made a bad situation worse. I removed MacPython by removing:
  • /Library/Frameworks/Python.framework
  • /Applications/MacPython 2.4
and built Python 2.4.4 from source. If you're extra paranoid like me, you can just move the above directories to .old.

ClearSilver Version
Version 0.10.4 still didn't want to play nice (and over at Trac they say it won't) so I went ahead and ran 0.9.14. It gave me a bunch of endedness warnings but ran cleanly. I still had a couple of issues with neo_cgi.so (/usr/bin/install didn't seem to want to copy it over and was even giving me a usage message from the command line), so I went into the python directory of the install and ran python setup.py install to shove it in.

PySQLite
Of course reinstalling Python broke my PySQLite installation, because it was all pointed at the old one at /Macs/Dirty/Secret/LongPath/Whatever. I got PySQLite 2.2.3 and reinstalled it, but then I got error messages on the import talking about it couldn't find _sqlite3_enable_shared_cache. A little research told me this means that it's linked to a different set of SQLite3 drivers than the ones that are loaded, so I went back and reinstalled agin, making sure my setup.cfg pointed to /usr/local/include and /usr/local/lib where my good SQLite3 headers were.

After all that, I ran tracd pointed at a single instance and it worked out fine.

No comments: