A magnitude 2.9 earthquake was detected by the U.S. Geological Survey near Puerto Rico.