Well, they did, to some extent.
There is probably a lot more to be said about ancients sailing past Gibraltar, but in the meantime you might like this thread where /u/mythoplokos talks about the theory that the Phoenicians circumnavigated Africa, as well as problems with this idea. In this thread /u/cleopatra_philopater gives some fantastic insight to Rome's contacts with Africa, including some details on exploration down the African coast, such as to the Canary Islands.