Spiking a gun only disabled it temporarily. Spikes could be drilled out, although this was time consuming and hardly possible during a battle so your enemy would effectively be denied the use of a spiked gun for the rest of the day.
There were instances where it was advantagious to permanently disable guns that could not be captured and towed away, e.g. sited batteries defending an enemy harbour. One technique was, I believe,to saw the trunnions off the barrel, or perhaps blow them off with explosive charges, similar to demolishing a bridge or building. A barrel that could not be securely mounted was useless.
If I were to try to blow up a gun barrel tonight I think I would overcharge the gun with a LOT of powder, wad, perhaps double shot?? for weight, fill the barrel with some material that will compress under the force of the explosion rather than be expelled like a projectile, probably sand, then seal with rammed clay, use a long fuse.
Water might also work but you would have to keep it sperate from the powder, more rammed clay.
Fine gravel works well enough in the small holes drilled for blasting with gelignite but i'm not sure how it would go in a gun muzzle.
The effect of this would be to blow out the vent rather than produce the banana peel barrels you see in the cartoons. As Mike said blowing up a bronze barrel that has been designed and expertly cast for the purpose of containing considerable explosions is not easy, but drill a hole in the barrel, the vent, and you have a natural weakness that can be attacked. the only reason vents did not blow out in normal use was the presence of a much bigger hole, the muzzle, at the other end.
Removing a chunk of metal of just a few inches from the vent would prevent enough compression to fire the projectile and as Alan says attempting to fire the gun like this would just produce a big firework, more likely to burn the crew than harm the target.
Mark Adkin in "The Waterloo Companion" states that farriers remained at the rear with the Regimental Staff during action.