rewrite ruby environment update script to use pushd/popd