I re-made a patch for VIM which works with Ruby 1.9. It affects file src/if_ruby.c, src/configure.in src/auto/configure. This patch provides the following features. (This patch is for Ruby 1.9, but keeps backword compatibility. I tested this patch works with ruby 1.8.7.)
(1) check ruby header directory in Ruby 1.9 (and Ruby 1.8). The header directory in Ruby 1.9 is different from Ruby 1.8.
(2) using Ruby1.9 C API instead of Ruby 1.8, although, this patch works with ruby 1.8 (keeping backword compatibility.)
(3) setting encoding of Ruby String with Ruby 1.9. (String encoding is new feature in Ruby 1.9.)
This patch is for Vim 7.2.234(Subversion revision 1577).
On Sun, Jul 26, 2009 at 09:10:07PM +0900, Masaki Suketa wrote: > I re-made a patch for VIM which works with Ruby 1.9.
Will this also work with 1.9.1, which (again) changed Ruby's API/ABI and where they expect Ruby libraries to reside? If not, it might be good to modify the patch to support 1.9.1 while changes are being made to the Ruby code.
-- James GPG Key: 1024D/61326D40 2003-09-02 James Vega <james...@jamessan.com>
James Vega wrote: > On Sun, Jul 26, 2009 at 09:10:07PM +0900, Masaki Suketa wrote: >> I re-made a patch for VIM which works with Ruby 1.9.
> Will this also work with 1.9.1, which (again) changed Ruby's API/ABI and > where they expect Ruby libraries to reside? If not, it might be good to > modify the patch to support 1.9.1 while changes are being made to the > Ruby code.
Sorry, I did not write my ruby environment. I tested the patch works with: + ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux] + ruby 1.9.1p243 (2009-07-16 revision 24174) [i686-linux] + ruby 1.9.2dev (2009-07-26 trunk 24278) [i686-linux]
And I have not tested with Ruby 1.9.0. I have tested my Linux box only.
Works like a charm.
Tested it with Ruby 1.9.1_p129-r99 on my Linux (Gentoo) box.
Everything works except for some minor glitches with rubycomplete
omnicompletion.
Sometimes this pops up:
`
Error detected while processing function rubycomplete#Complete:
line 22:
ArgumentError: comparison of Hash with Hash failed
Press ENTER or type command to continue
`
On 26 июл, 15:10, Masaki Suketa <masaki.suk...@nifty.ne.jp> wrote:
> I re-made a patch for VIM which works with Ruby 1.9.
> It affects file src/if_ruby.c, src/configure.in src/auto/configure.
> This patch provides the following features.
> (This patch is for Ruby 1.9, but keeps backword compatibility.
> I tested this patch works with ruby 1.8.7.)
> (1) check ruby header directory in Ruby 1.9 (and Ruby 1.8).
> The header directory in Ruby 1.9 is different from Ruby 1.8.
> (2) using Ruby1.9 C API instead of Ruby 1.8, although, this patch
> works with ruby 1.8 (keeping backword compatibility.)
> (3) setting encoding of Ruby String with Ruby 1.9.
> (String encoding is new feature in Ruby 1.9.)
> This patch is for Vim 7.2.234(Subversion revision 1577).
red-agent wrote: > Works like a charm. > Tested it with Ruby 1.9.1_p129-r99 on my Linux (Gentoo) box.
> Everything works except for some minor glitches with rubycomplete > omnicompletion. > Sometimes this pops up: > ` > Error detected while processing function rubycomplete#Complete: > line 22: > ArgumentError: comparison of Hash with Hash failed > Press ENTER or type command to continue > `
I need more detail information to fix it. Could you show me the script when the error message pops up?
> red-agent wrote:
> > Works like a charm.
> > Tested it with Ruby 1.9.1_p129-r99 on my Linux (Gentoo) box.
> > Everything works except for some minor glitches with rubycomplete
> > omnicompletion.
> > Sometimes this pops up:
> > `
> > Error detected while processing function rubycomplete#Complete:
> > line 22:
> > ArgumentError: comparison of Hash with Hash failed
> > Press ENTER or type command to continue
> > `
> I need more detail information to fix it.
> Could you show me the script when the error message pops up?
> Nothing to show, really. > That mostly happens when trying to complete the constant, like class > name...
I've not been able to produce the same error in my environment. I'm not a heavy user of rubycomplete omnicompletion. So, it seems to me to take a while to solve it. Anyway, thank you for your reporting.
I've problems with the compilation on the Mac. First of all the Mac
layout of the ruby install is a bit different so it looks for header
files in the different directory but with few symlinks it sort of
works. VIM compiles but with this results:
...
gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-
unknown-pragmas -pipe -I. -Iproto -DMACOS_X_UNIX -no-cpp-precomp -I/
Developer/Headers/FlatCarbon -g -O -I/usr/local/ruby-1.9.1-p243/
lib/ruby/1.9.1/i386-darwin9.7.0 -o objects/if_ruby.o if_ruby.c
if_ruby.c: In function ‘get_buffer_line’:
if_ruby.c:754: warning: format ‘%d’ expects type ‘int’, but argument 3
has type ‘linenr_T’
if_ruby.c: In function ‘set_buffer_line’:
if_ruby.c:795: warning: format ‘%d’ expects type ‘int’, but argument 3
has type ‘linenr_T’
if_ruby.c: In function ‘buffer_delete’:
if_ruby.c:841: warning: format ‘%d’ expects type ‘int’, but argument 3
has type ‘long int’
if_ruby.c: In function ‘buffer_append’:
if_ruby.c:875: warning: format ‘%d’ expects type ‘int’, but argument 3
has type ‘long int’
gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-
unknown-pragmas -pipe -I. -Iproto -DMACOS_X_UNIX -no-cpp-precomp -I/
Developer/Headers/FlatCarbon -g -O -I/usr/local/ruby-1.9.1-p243/
lib/ruby/1.9.1/i386-darwin9.7.0 -o objects/os_macosx.o os_macosx.c
gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-
unknown-pragmas -pipe -I. -Iproto -DMACOS_X_UNIX -no-cpp-precomp -I/
Developer/Headers/FlatCarbon -g -O -I/usr/local/ruby-1.9.1-p243/
lib/ruby/1.9.1/i386-darwin9.7.0 -o objects/os_mac_conv.o
os_mac_conv.c
gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-
unknown-pragmas -pipe -I. -Iproto -DMACOS_X_UNIX -no-cpp-precomp -I/
Developer/Headers/FlatCarbon -g -O -I/usr/local/ruby-1.9.1-p243/
lib/ruby/1.9.1/i386-darwin9.7.0 -o objects/netbeans.o netbeans.c
gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-
unknown-pragmas -pipe -I. -Iproto -DMACOS_X_UNIX -no-cpp-precomp -I/
Developer/Headers/FlatCarbon -g -O -I/usr/local/ruby-1.9.1-p243/
lib/ruby/1.9.1/i386-darwin9.7.0 version.c -o objects/version.o
gcc -L. -L/usr/local/lib -L/usr/local/lib -o Vim objects/
buffer.o objects/charset.o objects/diff.o objects/digraph.o objects/
edit.o objects/eval.o objects/ex_cmds.o objects/ex_cmds2.o objects/
ex_docmd.o objects/ex_eval.o objects/ex_getln.o objects/fileio.o
objects/fold.o objects/getchar.o objects/hardcopy.o objects/hashtab.o
objects/if_cscope.o objects/if_xcmdsrv.o objects/main.o objects/mark.o
objects/memfile.o objects/memline.o objects/menu.o objects/message.o
objects/misc1.o objects/misc2.o objects/move.o objects/mbyte.o objects/
normal.o objects/ops.o objects/option.o objects/os_unix.o objects/
pathdef.o objects/popupmnu.o objects/quickfix.o objects/regexp.o
objects/screen.o objects/search.o objects/spell.o objects/syntax.o
objects/tag.o objects/term.o objects/ui.o objects/undo.o objects/
window.o objects/gui.o objects/pty.o objects/gui_macvim.o objects/
MMBackend.o objects/MacVim.o objects/if_ruby.o objects/os_macosx.o
objects/os_mac_conv.o objects/netbeans.o objects/version.o -
framework Cocoa -framework Carbon -lncurses -liconv -lruby -
lpthread -ldl -lobjc
Undefined symbols:
"_ruby_errinfo", referenced from:
_ruby_errinfo$non_lazy_ptr in if_ruby.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [Vim] Error 1
I'm on Ruby 1.9.1p243
Any suggestions I could fix this?
Thanks a lot
Pavel
On Jul 29, 2:53 pm, Masaki Suketa <masaki.suk...@nifty.ne.jp> wrote:
> > Nothing to show, really.
> > That mostly happens when trying to complete the constant, like class
> > name...
> I've not been able to produce the same error in my environment.
> I'm not a heavy user of rubycomplete omnicompletion.
> So, it seems to me to take a while to solve it.
> Anyway, thank you for your reporting.
> I've problems with the compilation on the Mac. First of all the Mac
> layout of the ruby install is a bit different so it looks for header
> files in the different directory but with few symlinks it sort of
> works. VIM compiles but with this results:
> On Jul 29, 2:53 pm, Masaki Suketa <masaki.suk...@nifty.ne.jp> wrote:
> > Hello,
> > At 07/29/2009 04:57 PM, red-agent wrote:
> > > Nothing to show, really.
> > > That mostly happens when trying to complete the constant, like class
> > > name...
> > I've not been able to produce the same error in my environment.
> > I'm not a heavy user of rubycomplete omnicompletion.
> > So, it seems to me to take a while to solve it.
> > Anyway, thank you for your reporting.