In the past 10 years and 2 Macs, I accumulated a lot of stuff that needs to be transferred to my new laptop. So I took advantage of the Migration option that comes up during the first-boot system setup that all Macs have. So I booted my desktop machine into transfer disk mode by restarting while holding down the ‘t’ key, then connected both machines using a Firewire 800 cable. I transferred my user account stuff, the systems Applications, and settings (total: ~240 G). The initial estimate for the transfer was 23 hours but fortunately, once it had been running for a while, it revised the estimate to ~3.5 hours. Once the initial data transfer had completed, I started clearing out stuff I don’t want or won’t work on the new machine.
I had not chosen to transfer what the Setup Assistant referred to as “Other files”. Not sure what all that encompases, but for one thing, it did not transfer the /opt directory containing my MacPorts stuff. To complete the the removal of the MacPorts stuff, I cleared out environment stuff for /opt and my Oracle vars. The Oracle instant client doesn’t run on Lion, so I removed /Library/Oracle. I also used the uninstall section of the MacPorts docs to find out what to ‘rm -rf’ in various Library directories.
The next thing I needed was a compiler, so I installed Xcode 4.3.3 from the App Store. Even with Xcode installed, I still don’t have gcc?! Apparently now one needs to ask Xcode to install an optional command line tools extension. That can be found under Preferences -> Downloads. Unfortunately there appears to be a bug in some part of the Xcode install because after I installed it, my terminal, which had been working just fine, could not run emacs:
I also see a possibly related issue: I can’t use man pages from the command line:
I can’t live with that! Sounds like the fix is to copy in a known good usr/share/terminfo directory. But where can I get one? At the moment, the fastest option appeared to be to reinstall Lion and start again.
First I created a Lion recovery thumb drive using the instructions at http://support.apple.com/kb/HT4848 and the Lion Recovery Disk Assistant v1.0 downloaded from http://support.apple.com/kb/DL1433. Made a 2 G partition on the pink thumb drive (make sure partition table type is GUID under options) Then launched the LRDA and selected the LIONRECOVER partition to receive the data. The recovery stuff copied over in < 15 min and I was able to eject the disk.
To do the actual recovery, I needed to be connected to the internet. Wired network is the fastest - esp as I went to work and used their fast network. I restarted my laptop while holding down Command+R. Because this restart is before my settings kick in I had to use the real Command key - with the apple symbol on it. The laptop booted into recovery mode, checked with Apple to make sure this was a machine that shipped with Lion on it, and then reinstalled. The reinstall took about an hour and left all my user data intact and most of my applications.
Once it had rebooted, I had a nice complete set of /usr/share/terminfo and emacs was happy once more. I made a backup and then checked Xcode. Xcode was still installed in the Applications folder but when I started it, it went through the same ‘first time’ operations as it had the first time. When I looked at the Preferences -> Downloads the 2 iPhone simulator add ons that I had installed the first time were still installed. But the Command Line Tools showed they were not. I reinstalled them and then checked my term info by trying to run emacs again. Nope, same error message about my terminfo database. So clearly the root of the problem is with installing the Xcode command line tools. I untarred my backup terminfo directory and replaced the broken one with the original information from my clean install.
I already had some stuff installed in /usr/local. I don’t think I want most of it, but was concerned that just removing the directory contents would not cleanly uninstall everything. So for my first attempt, I followed the install instructions and ran the install script as:
Once that had run, it told me to run “brew doctor”. That gave me a lot of warnings about the things that were already installed. So I decided to remove things that were installed by homebrew (.gitignore, Cellar, Library, README.md), tarred up the rest, and cleared everything out of /usr/local. This time after I installed homebrew and ran “brew doctor” I got “system is raring to brew”.
So how do I figure out what formulas are available? One option is from
the command line:
brew search mysql. That will list all
available formulas that have mysql in their name. Another option is
searching on http://braumeister.org/
To find out what I have installed, I can look in
/usr/local/Cellar/. To find out what version of a package is currently
active, I can look at the symlinks in the bin or lib directories. Or I
can use the command line:
brew list wget; that will list
all the files associated with that package.
I may want to override some system packages with ones of my own, so in my .profile, I added /usr/local/bin into path before /usr/bin.
Lion has SQLite3 and Postgresql 9 already installed, but I don’t see any sign of MySQL so I installed MySQL 5.5 from brew. After installing, I get a bunch of instructions about creating databases and starting when I boot/login. So first of all, I need to install the main database:
The output from mysql_install_db gave me the familiar “be sure to set a root password” warning. It is less clear that you have to start mysql.server first and then use the mysql_secure_installation script.
To make the mysql server run when I log in, I followed the instructions that homebrew gave me upon install:
Lion comes with Ruby 1.8.7 installed and the gems from my previous Mac appear to have transferred. But for more recent rubies, I’ll want to use RVM. I had installed RVM on my previous Mac but haven’t really used it, so I think I’ll start over. First I removed the old RVM with “rvm implode”. Then I followed instructions at https://rvm.io/rvm/install/
This installed ruby 1.9.2-p194, gem, bundler, rvm, and rake. Then to do a basic rails install: