Perhaps there is something wrong with your nunchuck? If disconnecting and reconnecting it again doesn't work, the wire might be breached somewhere. If you have another nunchuck, try replacing your current one. If that's not it, the wii remote might not be recognizing the nunchuck like it should--but I'm pretty sure the "attach a nunchuck" message would appear if that were the case.
I really hope it's just the wire, because that's actually pretty common. It's actually happened to me recently. The wire sometimes picks up the controls, and other times, it doesn't. Those wires aren't really as durable as they should be since we're swinging them around all the time. Nintendo should have reinforced them or something. ;9