Invoke script correctly from rake task