the prefab you want to instantiate is null

I have this problem where the unity editor debug panel says that "the prefab you want to instantiate is null". I tried to search why did this happen but i don't know why. I have a prefab called "cube" and a camera called "camera" NOT "Main Camera". this is the code that goes into the prefab, "cube" :

function Update () {
if (Input.GetAxis("spawn")>0){
var cube:Rigidbody;
cube=Instantiate(cube,transform.position+Vector3(0,0,4),Quaternion.identity);
};
}

and this is the code that goes into "camera" :

var x:float;
var z:float;
function Update () {
x=Input.GetAxis("Horizontal");
z=Input.GetAxis("Vertical");
transform.Translate(0,0,z/5);
transform.Rotate(0,x,0);
}

Thanks in advance.

The main problem: you DONT have prefab. It is NULL because you have reinitialized it in next line:

var cube:Rigidbody; //problem in this line
cube=Instantiate(cube,transform.position+Vector3(0,0,4),Quaternion.identity);

First, try to add any object to your variable cube

for example:

var cube = GameObject.Find("AnyObjOnScene");
cube = Instantiate(cube,transform.position+Vector3(0,0,4),Quaternion.identity);

or make global var cube and attach object through Inspector