NoClassDefFoundError when doing gradle -v after installation

I have just installed gradle on a Ubuntu installation and am getting the following error when doing a gradle -v command to check if the installation was successful.

FAILURE: Build aborted because of an internal error.
  * What went wrong:
Build aborted because of an unexpected internal error. Please file an issue at:
  * Try:
Run with --debug option to get additional debug info.
  * Exception is:
java.lang.NoClassDefFoundError: org/apache/tools/ant/Main
 at org.gradle.util.GradleVersion.prettyPrint(
 at org.gradle.launcher.cli.CommandLineActionFactory$

I have tried installing ant but it hasn’t made any difference. Can someone point me in the direction of what I am missing. The version I downloaded was gradle-1.0-rc-3. Thanks.

Still not sure what was wrong but I just downloaded and extracted the gradle package again and now it is working.