Problem involving Ruby, git and cron


Sorry to post this here, it’s really a combined Ruby/Linux/Git problem
I’m hoping someone here can point me in the right direction. I’ve
written a
Ruby script that exports all known branches of some git repos to static
files, and optionally performs builds of JavaScript projects. It looks

To run: save this in a file, e.g. ~/widgets/export, make it executable
perform the following in the ~/widgets directory:

chmod +x export
mkdir repos
mkdir static
cd repos
git clone git://
git clone git://

Also, install these:

sudo gem install hoe grit jake

Then, go back to your home dir and run the script:

cd ~

You should see a ton of stuff appear in the ‘static’ dir. Also notice
the contents of static/js.class/0.9.0 and static/js.class/2.0.0 (for
example) are different. Next, set this script up to run under cron using
‘crontab -e’ (First digit is the minutes past the hour the script will
Replace my username with your own.)

crontab -e
40 * * * * /home/jcoglan/widgets/export

Wait for the script to run, then inspect the directories again. All
of js.class are now the same, whereas the heist versions are still
Also, If I remove the heist repo, js.class exports correctly.

I’ve no idea why any of this should be the case: any help would be very
gratefully received!