Jan 7 2011

Fresh Ruby & Rails Install on Snow Leopard

Download and Install XCode

XCode takes a while to download so we might as well start with this. You can continue on to the next steps while it downloads… until you run into a step that requires XCode

Download and Install MySQL

I’ve built mysql several times and haven’t find an advantage over installing it from the official DMG source. Installing it from the DMG is much easier and has a higher degree of success.

Just Google for “MySQL mac download”. It should take you to the MySQL download page. Download the 64-bit DMG and do the standard thing. Open it up and run the mysql install. Also add the System Preferences to make starting and stopping the MySQL service easier.

Update your Gems Environment

gem -v
gem environment
sudo gem update --system
sudo gem update
gem list --local

You might want to install hanna also. It’s an alternate rdoc template. I have it my system configured to automatically use hanna when generating rdoc.

sudo gem install hanna

Install Homebrew for your Unix Package Needs.

Homebrew is a nice simple package manager for OS X. Some alternatives are ports and fink. I’ve used them both before and prefer ports over fink.

ruby -e "$(curl -fsSL https://gist.github.com/raw/323731/install_homebrew.rb)"
brew

Once you install homebrew, you can easily install other packages. Ack “is a tool like grep, designed for programmers with large trees of heterogeneous source code.” Bash Completion helps make the bash command line easier to use. It’ll allow you to tab fill your ssh locations for example.

brew install git
brew install ack
brew install bash-completion

Install rvm

Here’s where we start adding some real meat to your system. rvm is not strictly necessary but highly recommanded.


# Install rvm
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
# set up rvm in .profile... or use rubyconsumer's dotfiles setup. (see below)
# To seamlessly abandon the Apple-installed system ruby (ruby 1.8.7 patchlevel 174 for Snow Leopard):
rvm install 1.8.7 # installs patch 302: closest supported version
rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system # migrate your gems
rvm --default 1.8.7

Set up Dotfiles

I have my dotfiles saved on github. I suggest either 1) look through and picking up what you need, 2) fork it, use it as is and start making your own additions. I've tried to keep it commented.

I place my configs into dropbox and symlink to them.


cd ~/Dropbox/wtsang

Clone or fork and clone dotfiles


git clone git@github.com:rubyconsumer/dotfiles.git

Set up dotfiles.


cd dotfiles
setup

My dotfiles project has a setup script which will non-destructively symlink to dotfiles. You'll need to modify it to work for you, until I make the appropriate changes since it's hardcoded to my Dropbox location.

Install Editor

Textmate is an obvious choice. If you are going to use vi, check out mac vim and carlhuda's Janus.


for i in ~/.vim ~/.vimrc ~/.gvimrc; do [ -e $i ] && mv $i $i.old; done
git clone git://github.com/carlhuda/janus.git ~/.vim
cd ~/.vim
rake


Oct 9 2008

Skype Regex FTW!

When messaging through Skype, it’s not unusual for geeks to write a little bit of regular expression to correct mistakes.

Example:
rubyconsumer> I like kake!
rubyconsumer> s/kake/cake/

Well it looks like the Skype client for the mac has taken this one step further.  And for once, the mac client is actually ahead of the windows client.

An up to date Skype client will now take that regex and run it against your last message.  The resulting message from the previous example would look like:

Example:
Editted: 10/9/08 7:30AM – rubyconsumer
rubyconsumer> I like cake!

Now that’s Geek Accessibility!

Now if only video sites like youtube would add key board shortcuts…

Blogged with the Flock Browser

Jul 8 2008

Full Finder Paths

I really love OS X. Things are done right or can be easily changed… for the most part.

A few though, need to be configured through secret command line incantations.

I’ve finally ran across a way to add the full path of the directory into the Finder.

defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES

Restart the Finder and volia!

There are more customizations available from the command line here.


Jul 7 2008

Menu ShortCut for Leopard

I ran across a great menu shortcut on Leopard.

Cmd-Shift-/ (aka. Cmd-?)

Now just type in your menu command and the result comes up like quicksilver/spotlight.

Hit enter and volia!

use help to select menu items in leopard


Jul 1 2008

Setting Up Unix Profiles In A Diverse Environment

I’ve recently made changes to my bash profile after getting sick and tired of managing multiple environments in one profile.

› Continue reading


May 15 2007

Getting Ready for RailsConf

It’s a couple days ’till RailsConf and not only did I decided to write in my sorely neglected blog but I also decided, for some strange reason, to reload my laptop. Brilliant!

Well, there are several reasons for reloading the old MBP.

    1. free up some space on the pitifully small 100GB HD
    2. install BootCamp so I can play my one turn per 24hrs in Civ 4.
    3. clear the financial data from my laptop before traveling with it.

As if all the craziness associated with going to a conference on the other coast for about week wasn’t enough.
I backed up my HD onto an external HD using Carbon Copy Cloner… just in case. First bit of fun was discovering I had the wrong set of install disks (not for the Mac Book Pro). I’m still working on the reload, but things are working out well so far. I still need to figure out how to transfer over my old Address Book and Key Chain, but things are looking good.

After I’m done with this reload, maybe after getting back from RailsConf, I need to make a Carbon Copy of my drive so I can easily get back to a fresh start.