I'm creating a log here of what I'm doing so that when people mock my failures later, they can do so accurately.
In the event that this all works out, I'll make some sort of post about switching to boxen from a brownfield machine.
I'd like to switch to boxen for a couple reasons:
- I'm hoping to get a new MBP in the fall and would like to be able to provision it quickly.
- Some friends are working on a puppet project. I'd like to learn enough to at least talk about it.
- I'm horrible at managing dependencies (more on that later).
My current develpment environment has a lot of things boxen won't like:
- RVM
- Existing homebrew
- Several manually linked libs that I've since forgotten about
- My
brew doctor
output
I'll need this dev machine in working order again in about 20 hours for my day job. I know it takes me about 3 hours to bootstrap a paved machine from my old checklist, so I won't start panicking until at least 8pm.
tmux kill-server
rvm implode
- remove rvm line from ~/.bashrc.local
- restart terminal
ruby -v
=> ERROR: Missing RVM environment file: '/Users/keith/.rvm/environments/jruby-1.6.3'ls -la ~/bin
=> all of my rubies are still simlinked to rvm stuffmv ~/bin ~/old_bin
- restart terminal
ruby -v
=> system ruby
- read wiki entry for uninstalling
- read gist for uninstalling
- read panic-inducing comment
- The gist has been updated since that comment. Screw it.
- Copy + Paste gist into terminal
[Process Completed]
last printed line wasrmdir -p bin Library share/man/man1 2> /dev/null
- In for a penny, in for a pound. Copy remaining lines of gist and paste those.
which brew
returns nothing. Success?
- Put boxen/our-boxen e736220c84 in a private repo
- Review preflight checklist
- Double check that XCode command line tools are installed
- Follow directions in README.md
- Review
Puppetfile
one more time script/boxen
- Wait.
- Add
[ -f /opt/boxen/env.sh ] && source /opt/boxen/env.sh
to the end of my ~/.bashrc.local - Tada?
- Set up user manifest requiring a single project
- Set up project manifest definining github location and ruby version
script/boxen
=> could not read Username for 'https://github.com': Device not configuredgit config -l
=> Everything looks right. Github username and token are set.git config --global credential.helper
=> /opt/boxen/bin/boxen-git-credential- Copy command puppet said it was running,
/opt/boxen/homebrew/bin/git clone --recurse-submodules https://github.com/Zeumo/zeumo /Users/keith/src/zeumo
and run it. The clone succeeds. Rerunscript/boxen
, same error. Wtf, puppet. - Replace "repo => 'Zeumo/zeumo'" with "repo => 'git@github.com:Zeumo/zeumo.git'". Everything works.
cd ~/src/zeumo
ruby -v
=> 2.0.0- Tada.
Here's the puppet manifest I have for zeumo at this point
class projects::zeumo {
boxen::project { 'zeumo':
ruby => '2.0.0',
source => 'git@github.com:Zeumo/zeumo.git'
}
}
But zeumo needs a lot more than just ruby. Let's puppetize this the rest of the way.
bundle
=> cryptic error than I know means capybara-webkit wants qt- Add "include qt" to top of zeumo project manifest
script/boxen
=> "Could not find class qt"- Adding qt to Puppetfile. I somehow remember that valid versions are the tags on the repo.
script/boxen
=> "Could not find class xquartz"- Yeah, I understand xquartz is a dependency for qt. It's listed in puppet-qt's README. puppet-qt doesn't have a Puppetfile, though, so it doesn't have a way to take care of this for me, I guess. Pandas weep.
- Adding xquartz to Puppetfile.
script/boxen
=> Failure
Notice: /Stage[main]/Qt/Homebrew::Formula[qt]/File[/opt/boxen/homebrew/Library/Taps/boxen-brews/qt.rb]/ensure: defined content as '{md5}9bc2e00a20846dd90e679c70f594e6f0'
Notice: /Stage[main]/Xquartz/Package[XQuartz]/ensure: created
Warning: Building source; cellar of libpng's bottle is /usr/local/Cellar
Error: Could not update: Failed running sudo -E -u keith /opt/boxen/homebrew/bin/brew install boxen/brews/qt
Error: /Stage[main]/Qt/Package[boxen/brews/qt]/ensure: change from absent to 4.8.4-boxen1 failed: Could not update: Failed running sudo -E -u keith /opt/boxen/homebrew/bin/brew install boxen/brews/qt
I thought maybe I'd gotten off too easy with my botched brew uninstallation. At this point I just guess at what's wrong.
brew uninstall libpng
script/boxen
=> Same error. Guessing isn't working, so I dig around for homebrew's logs.- I find the actual compile error in ~/Library/Logs/Homebrew/qt/02.make. Which lets me find the cause and its cause
- It turns out this was fixed in homebrew so I fork boxen/puppet-qt and apply the relevant bit of that diff and tag it 1.0.1. I update my Puppetfile and
script/boxen
again. - Two ice ages pass while qt compiles (~50 minutes)
bundle
succeeds- Create database.yml per the docs
- Add postgresql => true to project manifest. Add postgresql to Puppetfile and top of manifest.
script/boxen
- postgresql requires sysctl. Add that to Puppetfile and try again.
rake db:migrate
still fails because queue_classic has decided to disappoint me- Added an initializer to help queue_classic, and
rake db:migrate
passes rake
passes. My dev environment is fully operational again, and 2 hours before my self-imposed deadline.- beer