Refractive index is the measure of bending of a ray of light when passing from one medium into another. It is not necessary that one medium must be vaccum.
For example, the image below shows refraction, where first medium is air and second medium is water.