Ruby on Rails on Snow Leopard
I finally tackled the (hopefully) last bit of my Snow Leopard upgrade today: getting Ruby (and Rails) ready to go. I'm working on an information visualization project and am using Ruby to write the app. Mike Gunderloy at A Fresh Cup has a great step by step guide (I started at step 19 since I was happy to upgrade in place):
Migrating to Snow Leopard for Rails Development
As always happens when upgrading or installing, it seems, I did run into a few problems.
Errors and Workarounds
Problem: Git doesn't want to install.
Error:
ld: warning: in /opt/local/lib/libiconv.dylib, file is not of required architecture
Workaround:
MacPorts is to blame. To uninstall MacPorts, use
sudo rm -rf \
/opt/local \
/etc/manpaths.d/macports \
/etc/paths.d/macports \
/Applications/DarwinPorts \
/Applications/MacPorts \
/Library/LaunchDaemons/org.macports.* \
/Library/Receipts/DarwinPorts*.pkg \
/Library/Receipts/MacPorts*.pkg \
/Library/StartupItems/DarwinPortsStartup \
/Library/Tcl/darwinports1.0 \
/Library/Tcl/macports1.0
(Thanks, Simon Engledew)
Problem: MySQL gem doesn't install.
Error:
ERROR: Failed to build gem native extension mysql
Workaround:
Make sure you installed the latest version of MySQL, the MySQL Preference Pane, and that you started the MySQL server before trying to install the gem. iCoreTech has directions for installing MySQL and MySQL gem on Snow Leopard.
Other Options
HiveLogic has another method for installing Git on Snow Leopoard. I was having trouble with the package installers, and doing it "by hand" via HiveLogic's instructions worked well.
My project uses RMagick. RMagick's DMG installer wouldn't work for me either. I was able to install RMagick from source using a script from OnRails.org.
Get Upgraded SVN Working on a Mac OS X Server
Jeremy Whitlock has a great blog post about how to set up your OS X-based Subversion server. His post includes instructions for Apache configs, but not for svn+ssh. When you type
svn+ssh://user@host/repos
you'll likely get an error such as
svn: Expected FS format '2'; found format '4'
which means that you're repository was created in a newer version of SVN than the version you run when you call svn+ssh. Using Jeremy's instructions results in two versions of Subversion being available on your server - one in /usr/local and one in /opt/subversion. In order to use the one in /opt/subversion (the newest one) through an SSH tunnel, you need to make some SSH configuration changes on your server.
Getting svn+ssh to work requires:
1. Set (or uncomment) PermitUserEnvironment Yes in /etc/sshd_config (on server)
2. Add PATH=/opt/subversion/bin:$PATH to ~/.ssh/environment (on server; may have to create the environment file)
3. restart SSH (on server) with sudo /sbin/service ssh stop and sudo /sbin/service ssh start
Ta da!
Thanks for the jumpstart, Jeremy!
iPhone apps: Syphone
Updated 6/23/2010
As a commenter points out, Syphone doesn't work with current or recent iPhone OS. Don't waste your time.
Updated 2/21/2009
Syphone is a Mac freeware application that allows you to archive your iPhone SMS messages to your Mac hard drive. Here's a screenshot from my messages with Google Local:

Syphone screenshot
If you're using iPhone firmware 2.1+, you may get "No iPhones found!" in the drop down next to "iPhone" there near the top left. If so, go into Syphone's Preferences and uncheck the box marked "Run helper app in the background." Restart Syphone, and your iPhone and its messages should appear. You can change the colors, sort order, and export your messages to XML, PDF, or TXT.
Originally, I'd posted that I was unable to get the XML export to work. Ben commented that he was successful using XML export for one contact at a a time. This morning I tried again making sure I had one and only one contact selected. Success! Here's a screen shot of the XML output:

Syphone XML output
Now I'm definitely tempted to study text messaging. Any workgroups out there who all use iPhones and want to be in a study of text messaging at work?
Syphone stores its database in /Users/<username>/Library/Application Support/MobileSync/Backup.
Windows 7, or, Seeking Solace When Apple Makes Me Cry
Regular readers know I've had a rough time with Apple hardware lately. In fact, I forgot that I also had to have my 4th generation iPod replaced because the middle button stopped working. So, that means that only my iPod Shuffle has functioned as promised and not required service. Anyway, I'm intrigued by Windows 7 and took the plunge today. Well, as much plunge as one takes when making a virtual machine.
To get your own virtual Windows 7 machine, visit TuxDistro for a torrent. Yes, the virtual machine will work in Fusion on a Mac. Downloading the zip file through Vuze took me about 7 hours today.
First impressions? My goodness, Win7 boots fast. After I updated VMWare tools and clicked "restart," I switched back to Flock to Tweet about my new virtual machine. By the time I had logged in and read the first couple tweets my friends had posted, my Win7 machine was waiting for me to login. That was insanely fast. Certainly beat the pants off the Vista virtual machine I use every day. The new taskbar is a nice touch; it uses icons for running programs so it's easy to tell on which one you should click. I had no problems installing and running OpenOffice or Netflix Watch Instantly. I'll post again when I've given Win7 a true test. Also, some time this weekend I'll put a Win7 virtual machine on the Linux box downstairs and see how that goes. I got VMWare Player, a free program for running virtual machines, installed this morning, but then I had work to do. Stay tuned.
Why not Time Machine?
A couple of commenters asked why I use the ChronoSync + SuperDuper! combination instead of just Time Machine. The main reason? Time Machine uses too many resources. It's also slow. For awhile I avoided it because I wasn't sure how to make a bootable backup, but Mac OS X hints has instructions.
I don't always have my external hard drives plugged in since I'm rocking a laptop and am pretty mobile. Time Machine complained every hour, on the hour, that it couldn't find the drive it wanted for long enough to annoy me. Eventually it stops complaining about not being able to find the drive it wants.
Even if you leave the drive plugged in while working at your base location, for me it's my home office, Time Machine sucks up resources to do those intermittent backups. Even when I'm working on my dissertation, my data is not so mission-critical that it needs to be backed up every hour. Mac OS X Hints has a solution for changing the backup interval too.
ChronoSync can do in 39 minutes what it takes Time Machine over an hour to do. SuperDuper! beats the initial setup by about 20 minutes. So, the ChronoSync + SuperDuper! setup saves me resources, time, and headache.
One more thing - I have an Airport Extreme router, and I hang a hard drive off it via USB also. That drive is open to anyone on our home network. Apple's not kidding when they say Time Machine does not support network backups except to Time Capsule. When I tried using Time Machine to backup to that USB drive off the Airport Extreme, it would run my CPU up to about 80% and break many of my network connections. You may have better luck there. I didn't troubleshoot or try to fix it; I just gave up.
I ordered a rocstor ROCRAID from mwave last week, and that should be here on Tuesday. I'll try out RAID storage for my stuff and see how that goes. It has FireWire connections too, and I'm interested to see how much faster that can really be. I really don't want to have to give my laptop to Apple for a week. They won't let me keep the hard drive and send it in with a different one, and they won't give me a loaner. So I paid $2500 to have a laptop 98% of the time. Would I get it 100% of the time if I'd spent $3000? Sorry for the minirant, but having to get my MacBook Pro's fan fixed is what prompted this latest round of backup chatter.
TeX tip: Storing files in multiple folders
See, here's a TeX tip already. I have a somewhat strange filing system on my computer. It's marked by a number of behaviors that don't work smoothly with TeX - storing images in their own folder, keeping one giant references file instead of different ones for each paper, putting the main tex file in a folder by project rather than file type. So, this means that for any given TeX file, the .cls file that formats it, the references file where it's bibliography is stored, and the .tex file itself will be in 3 different folders. TeX doesn't like that. It's not easy to reference or include files in other folders within one's TeX document. So, I make symlinks for the files that live elsewhere. Symlinks are possible only on Mac (not Windows), and you can create them in Terminal. So, fire it up and navigate to the folder where your .tex file lives. Then use
ln -s [directory_with_file_you_want_to_include]/filename .
Note that space and period at the end. Those are important; they create the symlink instead of an alias. LaTeX actually doesn't care if you use an Alias instead of a symlink, but Subversion does. If you're using Subversion for version control (say you're writing a paper in LaTeX with your colleagues), Subversion will follow symlinks and update your project accordingly.
For example, I'm writing a CSCW paper with Sean and Jude that uses my "references.bib" file. That file is stored in "/Documents/endnote files/references.bib". I have a symlink in "/Documents/ResearchProjects/KNOWSI/CSCW 2008" for the references.bib file, and when I add citations, Subversion knows to grab the real file and commit that to our Subversion project. Cool, huh?
More about Subversion. Note: I recommend TortoiseSVN on PC for managing Subversion projects. I'm still hunting for a good Mac GUI (good = one that works!) I've tried Finder scripts, svnX, and RapidSVN with no success.
Saving money, writing in TeX
I've switched many of my writing tasks to TeX, and it's time I talked about that decision. I wrote a paper for a class last term in TeX, and I think that was the official beginning. Well, I guess I'd tried and failed to write a paper in TeX before, so my paper for Curtis LeBaron's class was my first success. EndNote and Office 2008 for the Mac don't get along yet, so TeX has a couple months to cement itself as my paper-writing environment of choice.
Some of you may have no idea what I'm talking about. For you, I recommend Wikipedia and CTAN: WHat are TeX, LaTeX, and Friends? Basically, TeX lets me write papers without having to format them at the same time. It uses tags to give formatting directions, then I run some command business, and wala, a PDF appears! I'm using it instead of Word because Word makes me angry when I'm trying to write papers for ACM conferences (e.g. GROUP, CSCW) with figures and/or tables. I'm also afraid of using Word for my dissertation because the rules about formatting are super-strict, and I bet Word could screw it up. TeX and the software I need to do my writing are also FREE. 100% FREE. The latest and greatest reason for me to use TeX, though, is that TeX + BibTeX works and Word 2008 + EndNote doesn't. Putting references into a paper by hand is not an option. My dissertation proposal is only 19 pages long, and 2 of those pages are a single-spaced citation list. Sean, Jude, and I are working on a paper for CSCW that has 9 references, and each reference appears in the text a couple of times. You can see that I'm not going to be able to keep track of all those citations myself, let alone switch between citation styles (e.g. between APA 5th and ACM proceedings).
So, TeX + BibTeX beat out Word 2008 + EndNote. How do I do it? I'm also using Windows occasionally now, and because TeX documents are plain text, they couldn't care less which OS I'm using. If you're somewhat comfortable with markup (e.g. HTML, XML), TeX may be a good option for you. Even with the student discount, Office 2008 is $50, and EndNote will probably be $90 again when they have a version that works with Office 2008 - likely summer 2008. Save yourself the $140 and give TeX a shot.
I use TeXShop and BibDesk on the Mac (available in the MacTeX package), and I wouldn't recommend other software. I tried iMacTeX or some such thing, and it was awful. TeXShop has a bunch of built-in AppleScripts that are helpful including Bibliography which automatically does the latex-bibtex-latex-latex order that you need to run in order to get a PDF with a properly formatted reference section. If you miss Bibliography in the dropdown list, you'll change the color scheme of your TeXShop windows, and there's no menu for resetting them. Instead, to change the background color of your source window, get the RGB values of the color you'd like, open up Terminal and use these commands (where XX = the appropriate R, G, or B value):
defaults write TeXShop background_R 0.XX
defaults write TeXShop background_G 0.XX
defaults write TeXShop background_B 0.XX
Similarly, you can change the colors of the text and the insertion point using foreground_R, insertionpoint_R and the like.
Now that I'm humming along on my dissertation and a couple of papers for CSCW, I'll probably be posting TeX tips. I get stuck a lot, and you probably will too when you get started.
New (to me) and not Useful: emacs therapist
Lifehacker comes through again with something fun. This time, it's a software Easter Egg - emacs Therapist! To use the emacs Therapist (Mac OS X only), open Terminal, type emacs, hit return, hit Escape, then type xdoctor. You get Eliza. Ha! That can kill some time.
If you're looking for other ways to kill time, may I recommend shopping for t-shirts? I found Palmer Cash recently, and it makes me pretty happy.
Swapping MacBook hard drives, including Boot Camp partition
Sigh. I use Parallels and Boot Camp because I like having options. Unfortunately, wanting options means that my life is quite complicated. Today's problem: swap out the failing hard drive in my MacBook for a new one without losing any of my Mac OS or Windows XP data. Well, it's actually this month's problem, but whatever. Judging by the amount of search results I get when looking for help online, lots of people want to move their Boot Camp partition to a new drive or to back it up. This should solve both those problems. Here's my setup:
- MacBook 2.0 GHz Core Duo
- 160GB internal drive (brand new; Leopard cloned my Mac OS disk partition from the old drive to the new one)
- 145GB Mac OS X partition (running fine)
- 15GB Boot Camp partition (formatted FAT32 by Boot Camp Assistant; empty)
- 160GB external drive (used to be internal, now in a case and attached via USB)
- 130GB Mac OS X partition
- 30GB Boot Camp partition (formatted FAT32 by BCA; runs fine)
- Parallels 3.0
- Winclone
- Windows XP SP2
And here's what I did:
Convert the external drive's Windows partition from FAT32 to NTFS:
- On the external Windows drive, go to Start - Run - and type
cmdto get the command line - At the prompt type
convert c: /fs:ntfswhere "c:" is the drive you want to convert to NTFS - Answer "No" to the first question - forcefully unmount the drive
- Answer "Yes" to the second question - convert on restart
- Restart your drive
I did all of that using Parallels so I could work on other stuff at the same time. When you restart, diskcheck will run a few times to convert the drive, and then it will restart in NTFS.
Once you've successfully converted your Windows drive to NTFS, you can clone it using Winclone. Winclone's site has good instructions, but here they are just in case:
- Make an image of the Windows partition you want to clone
- Store that image on your internal Mac OS partition (where you have Winclone installed)
- Restore the Winclone image to the empty Boot Camp partition
Questions
1. Why convert from FAT32 to NTFS?
I tried a number of ways of migrating my FAT32 drive (dd, Acronis True Image), and they all failed. Winclone works for NTFS drives and is a snap.
2. Won't converting from FAT32 to NTFS mean I can't write from my Mac to my Boot Camp drive or cause other problems?
Nope. The conversion happens without harming your data, so that's not a problem. As far as writing from Mac OS to NTFS, you can do so through Parallels. That's good enough for me, and NTFS adds protections and features that FAT32 can't offer. See Microsoft's site for more information about FAT32 vs. NTFS
3. How long does this take?
About two and a half hours from start to finish (18GB partition)
4. Winclone warned me about something happening to my partition; what should I do?
Winclone's just making sure you know that if you disconnect any of the partitions it's using while it's working, bad things will happen. As long as you leave everything connected while Winclone runs, you'll be fine.
5. Winclone thinks my Windows drive is FAT32, but I converted it to NTFS. What do I do?
Restart Winclone or click "Refresh" next to the Source drop down in the Backup tab. It should recognize your drive as NTFS then.
6. Will this work with Vista?
I have no idea. I bet, but I don't use Vista so can't be sure.
7. Where can I get a good deal on an external hard drive?
Try Amazon!