Question about "No such file to load -- rexml/encodings/ISO-8859-1.rb"

Hi all,

I am new to Ruby, so forgave me if this question has been asked before.
I am running a software on Windows XP which is written in Ruby . The
script has been converted to exe. I kept getting the following error
message when I run it.

No such file to load -- rexml/encodinigs/ISO-8859-1.rb
C:\DOCUME~1/username/LOCALS~1/Temp/eee.<executable

.2/lib/rexml/encoding.rb:33:in encodinig=': No decoder found for

encoding ISO-8859-1. Please install iconv.

I know that ISO-8859-1 is the encoder for Latin characters. I checked
the path shown in the error message and there is nothing Ruby there. I
installed Ruby in my computer after that and I do have the file
ISO-8859-1.rb under Ruby directory now. But I am still getting the same
message. So I am not sure if this problem comes up because I am using
Windows. Can I specify the library for the executable to link some how?

Thanks in advance.

Yaoyao

Hi,

your script has been converted to exe with rubyscript2exe
(http://www.erikveen.dds.nl/rubyscript2exe/index.html\) so maybe there
you can find some advice.

First, try adding path to the ISO....rb to %RUBYOPTS%:

set RUBYOPTS=%RUBYOPTS% -Ipath/to/iso88591.rb

and hope that the packed script will pick it up :wink:

If not, I would recommend extracting the archive (your.exe
--eee-justextract) and checking if the file is there. If not, you can
try to provide one (e.g. from your regular ruby installation, and make
sure that is as much similar version as possible) and repack.

I don't remember the exact process of repacking, I was something like
1. edit .eee file found in the unpacked dir (add reference to iso8859
file),
2. call eee.exe <the .eee file> <destination.exe>

Or, you can try running the script with your 'regular' ruby installation.

Good luck!

Jano

···

On 8/9/06, Yaoyao Gu <guy@ece.osu.edu> wrote:

Hi all,

I am new to Ruby, so forgave me if this question has been asked before.
I am running a software on Windows XP which is written in Ruby . The
script has been converted to exe. I kept getting the following error
message when I run it.

No such file to load -- rexml/encodinigs/ISO-8859-1.rb
C:\DOCUME~1/username/LOCALS~1/Temp/eee.<executable
>.2/lib/rexml/encoding.rb:33:in encodinig=': No decoder found for
encoding ISO-8859-1. Please install iconv.

I know that ISO-8859-1 is the encoder for Latin characters. I checked
the path shown in the error message and there is nothing Ruby there. I
installed Ruby in my computer after that and I do have the file
ISO-8859-1.rb under Ruby directory now. But I am still getting the same
message. So I am not sure if this problem comes up because I am using
Windows. Can I specify the library for the executable to link some how?

Thanks in advance.

Yaoyao

No such file to load -- rexml/encodinigs/ISO-8859-1.rb
C:\DOCUME~1/username/LOCALS~1/Temp/eee.<executable name> .2/lib/rexml/encoding.rb:33:in encodinig=':
No decoder found for encoding ISO-8859-1.
Please install iconv.
You might want to try to load the correct encoding explicitly:

require "rubyscript2exe.rb"
load "rexml/encodings/ISO-8895-1.rb" if RUBYSCRIPT2EXE.is_compiling?

Can you post the smallest test script in which the problem
still occurs?

gegroet,
Erik V. - http://www.erikveen.dds.nl/

Fix:

···

On 8/9/06, Jan Svitok <jan.svitok@gmail.com> wrote:

On 8/9/06, Yaoyao Gu <guy@ece.osu.edu> wrote:
First, try adding path to the ISO....rb to %RUBYOPTS%:

set RUBYOPTS=%RUBYOPTS% -Ipath/to/iso88591.rb

set RUBYOPTS=%RUBYOPTS% -Ipath/to/lib dir

i.e. set RUBYOPTS=%RUBYOPTS% -Ic:/ruby/lib/1.8

Jano

Thanks for the quick reply! Well, this didn't solve my problem. I guess
I need to run the project from source. I will try that!

Yaoyao

···

On Aug 09, 2006 05:44 PM, Jan Svitok <jan.svitok@gmail.com> wrote:

Fix:
On 8/9/06, Jan Svitok <jan.svitok@gmail.com> wrote:
> On 8/9/06, Yaoyao Gu <guy@ece.osu.edu> wrote:
> First, try adding path to the ISO....rb to %RUBYOPTS%:
>
> set RUBYOPTS=%RUBYOPTS% -Ipath/to/iso88591.rb

set RUBYOPTS=%RUBYOPTS% -Ipath/to/lib dir

i.e. set RUBYOPTS=%RUBYOPTS% -Ic:/ruby/lib/1.8

Jano

Hi Jano,

I have tried unpack the exe file, then add the reference of ICONV.rb and
ISO-8859-1.rb to the app.eee file. Then I repack the file and run it. I
still have the same error as before. I attached the following code that
generates this exception. Any hints?

begin
            load 'rexml/encodings/ICONV.rb'
            instance_eval @@__REXML_encoding_methods
            Iconv::iconv( UTF_8, @encoding, "" )
          rescue LoadError, Exception => err
            raise "Bad encoding name #@encoding" unless @encoding =~
/^[\w-]+$/
            @encoding.untaint
            enc_file = File.join( "rexml", "encodings", "#@encoding.rb" )
            begin
              load enc_file
              instance_eval @@__REXML_encoding_methods
            rescue LoadError
              puts $!.message
              raise Exception.new( "No decoder found for encoding #@encoding.
Please install iconv." )
            end
          end

···

On Aug 09, 2006 05:44 PM, Jan Svitok <jan.svitok@gmail.com> wrote:

Fix:
On 8/9/06, Jan Svitok <jan.svitok@gmail.com> wrote:
> On 8/9/06, Yaoyao Gu <guy@ece.osu.edu> wrote:
> First, try adding path to the ISO....rb to %RUBYOPTS%:
>
> set RUBYOPTS=%RUBYOPTS% -Ipath/to/iso88591.rb

set RUBYOPTS=%RUBYOPTS% -Ipath/to/lib dir

i.e. set RUBYOPTS=%RUBYOPTS% -Ic:/ruby/lib/1.8

Jano