you might simply lack the resource needed for this particular unit (iron is needed for frigates, coal is needed for ironclads, oil for destroyers and battleships, etc.).
if you have 2 iron, you can't have 3 frigates at the same time. if you have 4 coals, you can't have 5 ironclads at the same time.
by the way, you can get a resource by being friend with a city-state that has it.
i'm not a 100% sure but if you do have the required resource, the problem might be because of trade routes.
perhaps this city doesn't have a harbor or no route linked to the capital or to another city with a harbor and this might prevent it from building a unit requiring a resource that you have but not on the continent where this city is. in other words, you have the resource but not on the same continent as your city.
my work buddy is arguing with me on this at the moment. he says that trade routes have no incidence on your use of strategic resources but only on luxuries and gold. i'm not too sure.
try to build a harbour or try to link this city to a city with a harbour if this city is on a different continent than where the required resource is to see if it changes something. i'll have to check it out myself.
also, my friend says that if you have let's say 10 frigates but suddenly you don't have 10+ iron anymore, your units will be penalised in battle although i've never seen such a thing happened to me.
hope that helps.