# Ruby subversion bindings

**URL:** <https://www.ruby-forum.com/t/ruby-subversion-bindings/58241>\
**Category:** Ruby\
**Created:** [April 19, 2006, 11:10pm UTC](https://www.ruby-forum.com/t/ruby-subversion-bindings/58241 "2006-04-19T23:10:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pieter\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a88e57/32.png) [@Pieter\_E](https://www.ruby-forum.com/u/Pieter_E)\
**Post date:** [April 19, 2006, 11:10pm UTC](https://www.ruby-forum.com/t/ruby-subversion-bindings/58241/1 "2006-04-19T23:10:29Z")

</div>

Dear all,

I’m trying to run one of the examples included with the Ruby Subversion  
bindings:

$ svnlook.rb repos tree  
/usr/lib/ruby/site\_ruby/1.8/svn/util.rb:58:in `svn_repos_fs_wrapper': uninitialized constant Svn::Client (NameError) from /usr/lib/ruby/site_ruby/1.8/svn/util.rb:58:in`fs\_wrapper’  
from /usr/lib/ruby/site\_ruby/1.8/svn/repos.rb:85:in `fs' from ./svnlook.rb:34:in`initialize’  
from ./svnlook.rb:538

Now, the mentioned util.rb seems to be full of Ruby magic that i’m  
having a hard time debugging it. Isn’t this the correct way of calling  
svnlook.rb?

PS. Ending the repository path with a ‘/’ results in a different error:

$ svnlook.rb svn/ tree  
ruby: subversion/libsvn\_subr/path.c:114: svn\_path\_join: Assertion  
`is\_canonical (base, blen)’ failed.  
Geannuleerd

This is with ruby 1.8.4 (2005-12-24) [i686-linux] on Gentoo.

What am i doing wrong?

Thanks a lot,

---

<div class="post-metadata">

**Author:** ![Pieter\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a88e57/32.png) [@Pieter\_E](https://www.ruby-forum.com/u/Pieter_E)\
**Post date:** [April 20, 2006, 12:54am UTC](https://www.ruby-forum.com/t/ruby-subversion-bindings/58241/2 "2006-04-20T00:54:39Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Ruby subversion bindings” on Thu, 20 Apr 2006 06:08:27 +0900,  
Pieter E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Now, the mentioned util.rb seems to be full of Ruby magic that i’m  
> having a hard time debugging it. Isn’t this the correct way of calling  
> svnlook.rb?

The following will solve the problem:

% ruby -r svn/client -r svnlook.rb …

Or, could you add

require ‘svn/client’

into the svnlook.rb.

# I’ll fix the problem and commit the fix into the svn repository.

> PS. Ending the repository path with a ‘/’ results in a different error:
> 
> $ svnlook.rb svn/ tree  
> ruby: subversion/libsvn\_subr/path.c:114: svn\_path\_join: Assertion  
> `is\_canonical (base, blen)’ failed.  
> Geannuleerd
> 
> This is with ruby 1.8.4 (2005-12-24) [i686-linux] on Gentoo.
> 
> What am i doing wrong?

A repository path passed to Svn::Repos.open must be canonical.

If you want to use svnlook.rb with more convenience, replace  
the following line in svnlook.rb (last line)

SvnLook.new(path, rev, txn).run(cmd)

with

SvnLook.new(basename(path), rev, txn).run(cmd)

Thanks,

---

<div class="post-metadata">

**Author:** ![Pieter\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a88e57/32.png) [@Pieter\_E](https://www.ruby-forum.com/u/Pieter_E)\
**Post date:** [April 20, 2006, 7:27pm UTC](https://www.ruby-forum.com/t/ruby-subversion-bindings/58241/3 "2006-04-20T19:27:09Z")

</div>

Kouhei S. wrote:

> # I’ll fix the problem and commit the fix into the svn repository.

[…]

> > PS. Ending the repository path with a ‘/’ results in a different error:

> A repository path passed to Svn::Repos.open must be canonical.
> 
> If you want to use svnlook.rb with more convenience, replace  
> the following line in svnlook.rb (last line)
> 
> SvnLook.new(path, rev, txn).run(cmd)
> 
> with
> 
> SvnLook.new(basename(path), rev, txn).run(cmd)

Thanks a lot Kou!
