Similar Threads:
1.rubyscript2exe.rb issue
I have created some script which runs fine when i ran it from the
command promt ruby file.rb.
but when i conver it to exe using rubyscript2exe & tried to ran the
exe it gave me following error
I didnt find WINDOWS-1252.rb file on my machine. so question
1)how it running from command prompt without this file
I also tried packing the iconv.rb file into exe package but still no
luck
Can anybody please help me on this?
Vinod
----------------------------------------------------------------------------------------------------------------------
no such file to load -- rexml/encodings/WINDOWS-1252.rb
C:/DOCUME~1/VINOD_~1/LOCALS~1/Temp/eee.solutionfile.exe.2/lib/rexml/
parsers/treeparser.rb:89:in `parse': #<ArgumentError: No decoder found
for encodin
g WINDOWS-1252. Please install iconv.> (REXML::ParseException)
C:/DOCUME~1/VINOD_~1/LOCALS~1/Temp/eee.solutionfile.exe.2/lib/rexml/
encoding.rb:42:in `encoding='
C:/DOCUME~1/VINOD_~1/LOCALS~1/Temp/eee.solutionfile.exe.2/lib/rexml/
source.rb:47:in `encoding='
C:/DOCUME~1/VINOD_~1/LOCALS~1/Temp/eee.solutionfile.exe.2/lib/rexml/
parsers/baseparser.rb:203:in `pull'
C:/DOCUME~1/VINOD_~1/LOCALS~1/Temp/eee.solutionfile.exe.2/lib/rexml/
parsers/treeparser.rb:21:in `parse'
C:/DOCUME~1/VINOD_~1/LOCALS~1/Temp/eee.solutionfile.exe.2/lib/rexml/
document.rb:190:in `build'
C:/DOCUME~1/VINOD_~1/LOCALS~1/Temp/eee.solutionfile.exe.2/lib/rexml/
document.rb:45:in `initialize'
C:\DOCUME~1\VINOD_~1\LOCALS~1\Temp\eee.solutionfile.exe.2\app
\solutionfile.rb:25
C:\DOCUME~1\VINOD_~1\LOCALS~1\Temp\eee.solutionfile.exe.2\app
\solutionfile.rb:20
C:\DOCUME~1\VINOD_~1\LOCALS~1\Temp\eee.solutionfile.exe.2\bootstrap.rb:
50
...
No decoder found for encoding WINDOWS-1252. Please install iconv.
Line: 1
Position: 47
Last 80 unconsumed characters:
from C:/DOCUME~1/VINOD_~1/LOCALS~1/Temp/eee.solutionfile.exe.2/
lib/rexml/document.rb:190:in `build'
from C:/DOCUME~1/VINOD_~1/LOCALS~1/Temp/eee.solutionfile.exe.2/
lib/rexml/document.rb:45:in `initialize'
from C:\DOCUME~1\VINOD_~1\LOCALS~1\Temp\eee.solutionfile.exe.
2\app\solutionfile.rb:25
from C:\DOCUME~1\VINOD_~1\LOCALS~1\Temp\eee.solutionfile.exe.
2\app\solutionfile.rb:20
from C:\DOCUME~1\VINOD_~1\LOCALS~1\Temp\eee.solutionfile.exe.
2\bootstrap.rb:50
2.Question about tempfile.rb - Ruby vs C
Hi all,
Just curious - why was Ruby's temporary file handling class
(tempfile.rb) written in pure Ruby instead of using the tmpfile()
function? That function appears to be supported on most platforms,
including MS Windows.
Are there file locking or threading issues I'm not aware of?
The tmpfile() function does have the advantage of deleting itself when
all references to it are gone, instead of waiting until the Ruby
process itself dies. Perhaps there's no real advantage to that,
though?
Like I said, not an issue, just curious.
Regards,
Dan
PS - Below is a simple version I created for Solaris (before I
realized how ubiquitous the tmpfile function was):
#include <ruby.h>
#include <stdio.h>
#define VERSION "0.0.1"
VALUE mSolaris, cTempfile;
/* :call-seq:
* Solaris::Tmpfile.new => file
*
* Creates a new, anonymous temporary file in your Tempfile::TMPDIR
directory,
* or /tmp if that cannot be accessed. If your $TMPDIR environment
variable is
* set, it will be used instead. If $TMPDIR is not writable by the
process, it
* will resort back to Tempfile::TMPDIR or /tmp.
*/
static VALUE tempfile_init(VALUE self){
VALUE v_args[1];
v_args[0] = INT2FIX(fileno(tmpfile()));
rb_call_super(1, v_args);
}
void Init_tempfile(){
mSolaris = rb_define_module("Solaris");
cTempfile = rb_define_class_under(mSolaris, "Tempfile", rb_cFile);
rb_define_method(cTempfile, "initialize", tempfile_init, 0);
rb_define_const(cTempfile, "TMPDIR", rb_str_new2(P_tmpdir));
rb_define_const(cTempfile, "VERSION", rb_str_new2(VERSION));
}
3.setup.rb question
Hi,
I'm packaging a ruby extension, and want setup.rb to perform
a particular part of the install only on a particular platform.
I figure others may have dealt with this with their own
extensions, and I was wondering how it's usually done.
On win32, I'm including a pre-built .dll that my extension
requires, because it's kind of a pain to build on windows.
I've put the .dll in the bin/ directory - and setup.rb does
the right thing (for windows) and installs the .dll alongside
the ruby.exe binary, wherever that may be on the system.
However, on Linux, the shared library .so's needed by the
extension a) are easy to build, so I see no need to include
pre-built ones, and b) don't belong next to the ruby
executable anyway... and c) I certainly don't want the
win32 .dll copied into /usr/bin or wherever on Linux. :)
So my question is how to have setup.rb do the right thing
on windows with the files in ./bin (which it currently is)...
and basically ignore the files in ./bin on Linux.
Is it typical to just hack setup.rb to add the desired
behavior? Just wondering how it's usually done.
Thanks,
Bill
4.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
name>.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
5.mkmf.rb questions
6. Newbie Question. eval.rb variable scope issue
7. resolv.rb question
8. from irb to .rb? and general question