s:rubypath in ftplugin/ruby.vim

Tim Pope vim-ruby-devel at tpope.info
Tue Jan 23 11:45:16 EST 2007

On Mon, Jan 22, 2007 at 07:57:39PM -0500, Mark Guzman wrote:
> Tim Pope wrote:
> >
> > As you may recall from our IRC discussion, I was quite skeptical :).
> > Yesterday, I encountered a user with an actual problem with this.  Vim
> > was segfaulting everytime he edited a Ruby file after updating to the
> > latest vim-ruby scripts.  This use of the Vim Ruby interface turned
> > out to be the problem.  We never pinned down the true cause (probably
> > something broken in the way Vim or Ruby was compiled).  The Vim Ruby
> > interface has always seemed like a dirty hack.  Often times when using
> > it, I get errors like:
> >
> This doesn't occur unless rails.vim is loaded. I'm still searching for 
> the actual cause, but I can confirm that this is the reason under 
> osx,fbsd, solaris, and linux. I've been testing with the cvs version of 
> rubycomplete and the rails.vim from your site. This seems to match up 
> with the user reports also, though I haven't had them run it without 
> rails.vim.

Very odd.  rails.vim only recently started making use of the Vim-Ruby
interface.  The next revision will limit it to Windows only; perhaps I
should just do away with it all together (although I can't reproduce
any of these problems on Windows).  For the record, rails.vim uses it
in two places which previously used system():

1. require 'action_view' and extract a list of helper methods from it.

2. require 'yaml' and parse database.yml (only if dbext.vim is installed)

On my system, I observe the following behaviors.  If the first is
performed, with or without the second. the stack overflow error starts
to be seen when completion is used.  If the second is performed
*without* the first, Vim will segfault when completion is used.
Things work fine if you :ruby require the same libraries manually, and
things still break if all rails.vim does is require the same
libraries.  Perhaps is has something to do with how things are nested
in a Vim function.  I will investigate further.

> Have you actually experienced a crash due to the path discovery code?

No.  This user claims to have, even without rails.vim loaded.
g:rubycomplete_rails might have been set.



More information about the vim-ruby-devel mailing list