More than 500 people have been evacuated from a cruise ship off Puerto Rico after a fire erupted in the engine room.