The U.S. Navy is warning ships to stay away from the coast of Somalia after a series of pirate attacks there .