TMP_RUBY_PREFIX is sets incorrect values in gem prelude when ruby is
installed
in HOME.

On Nov 11, 1:24 am, Bram Moolenaar <[email protected]> wrote:
> Yasuhiro Matsumoto wrote:
> > So I sent following e-mail to google group, Sorry about duplicate
> > post.
> > -------------
> > Hi.
>
> > I got following error while loading ruby script file every time.
>
> >   "Encoding::ConverterNotFoundError: code converter not found
> > (UTF-16LE to ASCII-8BIT)"
>
> > The cause is that Encoding::Converter using module 'Gem' and it should
> > be auto-loading ruby-gems. I refered ruby's codes. and I found bits
> > workaround(?) code in ruby.c:
> >  http://github.com/yugui/ruby/blob/trunk/ruby.c#L1086
>
> > I wrote a patch for this problem.
> > Please check and include.
>
> [...]
>
> > @@ -646,6 +655,10 @@
> >        ruby_io_init();
> >  #ifdef RUBY19_OR_LATER
> >        rb_enc_find_index("encdb");
> > +
> > +      rb_define_module("Gem");
> > +      Init_prelude();
> > +      rb_const_remove(rb_cObject, rb_intern2("TMP_RUBY_PREFIX", 15));
> >  #endif
> >        ruby_vim_init();
>
> I can see some references to using rb_define_module() and Init_prelude()
> like this.  But why the rb_const_remove() call?  What happens if we
> leave it out?
>
> I also wonder if this works will all versions of Ruby.
>
> --
> Every exit is an entrance into something else.
>
>  /// Bram Moolenaar -- [email protected] --http://www.Moolenaar.net  \\\
> ///        sponsor Vim, vote for features --http://www.Vim.org/sponsor/\\\
> \\\        download, build and distribute --http://www.A-A-P.org       ///
>  \\\            help me help AIDS victims --http://ICCF-Holland.org   ///

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui