Update `after_restart.rb` to work across environments.

Squashed commit of the following:

commit c73489acf1f9a82191816e4eeb1b9953405fa127
Merge: 4cd014a 6d368fb
Author: Timothy Andrew <mail@timothyandrew.net>
Date:   Wed Jan 9 16:32:04 2013 +0530

    Merge branch 'master' into delayed_job_hook

commit 4cd014a69cba76c90c418e35e1b8be23f64e7356
Author: Timothy Andrew <mail@timothyandrew.net>
Date:   Wed Jan 9 16:26:02 2013 +0530

    use vars to get current path

commit 5d4d388e9144f8592e8fa0c342df03d651679e17
Author: Timothy Andrew <mail@timothyandrew.net>
Date:   Wed Jan 9 16:21:10 2013 +0530

    Use the correct path

commit baeb40055990ed8bda3617080d650e4810098421
Author: Timothy Andrew <mail@timothyandrew.net>
Date:   Wed Jan 9 16:15:40 2013 +0530

    Try doing env interpolation

commit 9aa8f2ec6657777738ba6ca1edccce48b2fe0fba
Author: Timothy Andrew <mail@timothyandrew.net>
Date:   Wed Jan 9 16:10:02 2013 +0530

    Try figuring out what the environment is