I have tried castor oil. I have also tried poison peanuts and the $2/worm newfangled rubbery worm poison. I have tried the little clicky windmill thing and the solar and/or battery powered sonic repellers (one of which was actually pushed out of the ground by a mole.) I have tried smoke bombs, flooding, and running a hose from the exhaust pipe of the car into the tunnels.
It’s been a few years since I did the research so I don’t have links handy, but if you look around you will find two types of sites about getting rid of moles: those that are trying to sell you a gadget or gimmick, and those that tell you gadgets or gimmicks other than traps don’t work. The ones telling you that only trapping works tend to be university agricultural sites and professional exterminators and the like.
Penn State College of Agricultural Sciences PDF on moles.
If you’re talking about a small flower bed or two and don’t care if the moles run through the rest of the yard the bit in that PDF about underground fencing might work for you.
There is one more thing that works: The Rodenator