You can download SWIG from it’s site: http://www.swig.org/
If you plan to run a vesion of Subversion older than 1.2.3, you will need to use SWIG 1.3.24. Otherwise use SWIG 1.3.25
SWIG 1.3.26 does not seem to work correctly with Subversion 1.2.3, so stick with 1.3.25.
Compiling uses the normal ./configure, make, make install procedure. It should find your Ruby install and use it automatically.