I recently setup my new Mac on Mavericks and didn’t want to do yet another install and document it… so I took an existing laptop setup script from thoughtbot and made a few changes for use with manageiq so the code can document it.
The laptop script has support for mac and linux although linux assumes a debian based system.
The script for Mac from thoughtbot:
- Configures zsh as default shell
- installs homebrew, postgres, redis, vim, ctags, tmux, openssl, some other packages I probably don’t need but it’s not a big deal to keep around
My changes were basically:
- Used chruby instead of rbenv
- Used ruby-install instead of ruby-build
- Installed latest ruby 1.9.3, 2.0.0, and 2.1.2
- Installed old bundler 1.3.5 in each ruby
- Installed gcc 4.8 as per chruby documentation to be able to install old rubies
- Install and start memcached and configured it to start at boot
The laptop script works by separating the various common and specific (linux/mac) components into files and listing those files in a manifest file for each where the manifest only contains the list of files relevant to the system.
You can then do:
build a single file you can execute to install the various packages
run the linux install script
or run the mac install script
Instead of modifying the mac script from thoughtbot, I created a new one for chruby, Manifest.mac.chruby by copying the Manifest.mac and adding and removing some files (remove rbenv, added chruby files)
diff --git a/Manifest.mac b/Manifest.mac.chruby index bc962ae..9f99dff 100644 --- a/Manifest.mac +++ b/Manifest.mac.chruby @@ -7,13 +7,12 @@ common-components/zsh mac-components/zsh-fix mac-components/homebrew mac-components/packages +mac-components/miq-packages mac-components/start-services -mac-components/rbenv +mac-components/chruby mac-components/compiler-and-libraries -common-components/ruby-environment +common-components/ruby-environment-chruby mac-components/bundler -common-components/default-gems -mac-components/heroku mac-components/github mac-components/rcm common-components/personal-additions
See our fork here
You can clone this locally and do this on mac:
./bin/build.sh bash mac.chruby
Note, I did this on mavericks. I’m not sure how well it works with older OSX’s.