The One Ring has corrupted Sméagol into Gollum, turning him into a mere servant. The One Ring is everything Gollum holds valuable. Frodo cunningly uses this against him by making him promise his loyalty by the Ring. Gollum naturally has no reason not to make the oath, as it is the only way to prolong his proximity to the artifact.
And as it turns out, the oath withstood the test of time; up until his defeat Gollum serves Frodo (his betrayal of the oath happening only hours before his demise, at a point where the Ring's influence reaches peak efficiency).
Was this actually the power of the Ring, or was it Gollum's own dread or veneration for it?
Even in the books this is not completely clear. But there are allusions to it, among which:
Then suddenly, as before under the eaves of the Emyn Muil, Sam saw these two rivals with other vision. A crouching shape, scarcely more than the shadow of a living thing, a creature now wholly ruined and defeated, yet filled with a hideous lust and rage; and before it stood stern, untouchable now by pity, a figure robed in white, but at its breast it held a wheel of fire. Out of the fire there spoke a commanding voice.
"Begone, and trouble me no more! If you touch me ever again, you shall be cast yourself into the Fire of Doom."
Frodo is speaking, but the commanding voice could well be an aspect of the Ring, clearly giving authoritative power to its wielder.
Although an extension of Sauron, its user obviously influences its machinations. Frodo is the master of the Ring when Gollum makes the oath, so the idea that the Ring will effectuate such an oath is very likely.