The generating hypothesis in the derived category of a ring