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.

http://gist.github.com/raw/612876/45261d2b395cce87d23a4072e1379e6b45175d5f/if_ruby_gem.diff

Thanks.
- Yasuhiro Matsumoto

diff -r fae782ef63dd src/if_ruby.c
--- a/src/if_ruby.c     Thu Sep 30 21:47:56 2010 +0200
+++ b/src/if_ruby.c     Wed Oct 06 14:20:19 2010 +0900
@@ -216,6 +216,9 @@
 # define rb_enc_find_index             dll_rb_enc_find_index
 # define rb_enc_find                   dll_rb_enc_find
 # define rb_enc_str_new                        dll_rb_enc_str_new
+# define rb_intern2                    dll_rb_intern2
+# define rb_const_remove               dll_rb_const_remove
+# define Init_prelude                  dll_Init_prelude
 # define rb_sprintf                    dll_rb_sprintf
 # define ruby_init_stack               dll_ruby_init_stack
 #endif
@@ -302,6 +305,9 @@
 static int (*dll_rb_enc_find_index) (const char*);
 static rb_encoding* (*dll_rb_enc_find) (const char*);
 static VALUE (*dll_rb_enc_str_new) (const char*, long, rb_encoding*);
+static ID (*dll_rb_intern2) (const char*, long);
+static void (*dll_Init_prelude) (void);
+static VALUE (*dll_rb_const_remove) (VALUE, ID);
 static VALUE (*dll_rb_sprintf) (const char*, ...);
 static void (*ruby_init_stack)(VALUE*);
 #endif
@@ -409,6 +415,9 @@
     {"rb_enc_find_index", (RUBY_PROC*)&dll_rb_enc_find_index},
     {"rb_enc_find", (RUBY_PROC*)&dll_rb_enc_find},
     {"rb_enc_str_new", (RUBY_PROC*)&dll_rb_enc_str_new},
+    {"rb_intern2", (RUBY_PROC*)&dll_rb_intern2},
+    {"rb_const_remove", (RUBY_PROC*)&dll_rb_const_remove},
+    {"Init_prelude", (RUBY_PROC*)&dll_Init_prelude},
     {"rb_sprintf", (RUBY_PROC*)&dll_rb_sprintf},
     {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack},
 #endif
@@ -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();

-- 
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