A) The lens is what Nikon calls a non-CPU lens, lacking the electrical contacts for things like autofocus and aperture control. With such lenses, you must use the Manual (M) mode. You won't be able to use the camera's light meter, and you have to adjust the aperture by turning the ring on the lens.
B) The lens is a D-type lens, with an aperture ring. You have to turn the aperture ring to its minimum (largest F/number) and lock it.
C) The contacts are dirty or otherwise not engaging properly. Clean the contacts on the back of the lens and on the lens mount. Reattach the lens and jiggle it slightly to try to engage the contacts.
If none of the above apply, then the camera and/or the lens may need service.
Answers & Comments
There are several possible reasons for this.
A) The lens is what Nikon calls a non-CPU lens, lacking the electrical contacts for things like autofocus and aperture control. With such lenses, you must use the Manual (M) mode. You won't be able to use the camera's light meter, and you have to adjust the aperture by turning the ring on the lens.
B) The lens is a D-type lens, with an aperture ring. You have to turn the aperture ring to its minimum (largest F/number) and lock it.
C) The contacts are dirty or otherwise not engaging properly. Clean the contacts on the back of the lens and on the lens mount. Reattach the lens and jiggle it slightly to try to engage the contacts.
If none of the above apply, then the camera and/or the lens may need service.