Installing the Subversion Ruby bindings

The Subversion bindings for Ruby is available from Subversion 1.2 and up. Since they are a fairly new addition they can be a bit of a hassle to setup on some systems. The requirements of the svn bindings are SWIG 1.3.24 for Subversion 1.2.x and SWIG 1.3.25 for Subversion 1.2.3

The correct way to install the Ruby bindings once you’ve configured, maked and installed subversion is (unfortunately this doesn’t seem to be covered in the svn 1.2.x docs):

$ make swig-rb
$ make check-swig-rb (optional, but you probably want to run these tests)
$ make install-swig-rb (as root)

Common errors, FAQ

Problems compiling SWIG

Subversion 1.2.x only supports SWIG 1.3.24 Subversion 1.2.3+ supports SWIG 1.3.25

Users report that things like:

usr/local/share/swig/1.3.24/ruby/rubydef.swg: In function `SWIG_Ruby_InitRuntime':
/usr/local/share/swig/1.3.24/ruby/rubydef.swg:48: error: `swig_type_list_handle' undeclared (first use in this function)

Are usually fixed by updating SWIG to 1.3.25.

If you get the following error, it is because you are running SWIG 1.3.26, which Subversion 1.2.3 does not support

/usr/local/share/swig/1.3.26/ruby/rubydef.swg: In function `SWIG_Ruby_ConvertPtr':
/usr/local/share/swig/1.3.26/ruby/rubydef.swg:152: error: `SWIG_RubyRemoveTracking' undeclared (first use in this function)
/usr/local/share/swig/1.3.26/ruby/rubydef.swg:152: error: (Each undeclared identifier is reported only once
/usr/local/share/swig/1.3.26/ruby/rubydef.swg:152: error: for each function it appears in.)
make: *** [subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.lo] Error 1

I got the following libtool error when executing make swig-rb: none: command not found Configuring subversion with

./configure --with-swig=/usr/local/bin/swig

solved the problem

Problems on x86_64

I ran into problems with SuSE 9.3 on x86_64. (Ruby 1.8.5, SWIG 1.3.25, Subversion 1.4.2)

Apart the usual SuSE-problems, building the bindings failed at first.

make swig-rb exited with an error, one of the last messages was:

... relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC

Configuring subversion with

./configure --enable-shared

solved this problem.

Testing Ruby SVN bindings

To make sure everything is installed correctly, open up irb and type require ‘svn/core’. If irb returns true you’re all set!

$ irb
irb(main):001:0> require 'svn/core'  
=> true

irb(main):002:0> exit

Reference:

 
svnbindings/install.txt · Last modified: 2007/01/04 11:35 by kronn
 
Recent changes RSS feed