You can't expect the `dist/` folder to always be in the users home folder like it is on the dev-server.  (For example, on Jenkins build agent you will be working from a the "job" folder, which varies depending on how the agent is setup.)
 
One of the features in grunt-shelljs is that your working folder is always set to the folder that the Gruntfile.js lives in; and I think the Rake based build should do something similar (ie, specify all paths relative to the folder the Rakefile lives in.).

Looks like [`File.dirname(__FILE__)`](http://stackoverflow.com/questions/236538/rake-and-current-directory) might be what you are after