From: bbiker Date: 2009-07-01T10:00:08+09:00 Subject: Re: RubyScript2Exe fix for bug in line 621? On Jun 30, 5:56 pm, __ __ wrote: > I am new to Ruby, but not to programming.  I have spent several hours > researching how to get RubyScript2Exe to work with Ruby version > 1.8.6-p287. > > RubyScript2Exe is no longer maintained, however.  Because of this, there > is a bug in line 621 that, with version 1.8.6-p287 of Ruby, produces > this error, (without the quotes): > > "rubyscript2exe.rb:621:in 'replace': can't modify frozen string > (TypeError)" > > In my research, I came across this: > > http://www.ruby-forum.com/topic/183234 > > There, it is suggested that line 621, which is: > > $0.replace(File.expand_path("./init.rb")) > > ..should be replaced by: > > $0 = File.expand_path("./init.rb") > > Maybe this works for some people, I don't know.  I do know that it > didn't work for me. > > Later in my research, I found this: > > http://rha7dotcom.blogspot.com/2008/09/rubyscript2exerb-and-623-cant-... > > First, a quick note to avoid confusion.  The blogger mistakingly said > the bug is on line 623.  This is probably because he added a few lines > somewhere earlier on in the program. > > Anyway, it is suggested that the buggy line (which is line 621) should > be replaced by: > > $_0 = File.expand_path("./init.rb") > alias $__0 $0 > alias $0 $_0 > > It seems that this fix may have helped some people.  However, it did not > work when I tried it.  There was no error, but it didn't make the exe. > > The OS I tried it on was Vista. The program I was trying to compile was > a one line Hello World program with the filename "Hello_World" (without > the quotes). > > By the way, technically, it seems that the bug is not in RubyScript2Exe > but in the program that compresses it.  However, they are both located > in the same Ruby file. > > If you need to ask any more information to diagnose the problem, go > ahead. > > Could anyone please make a fix that works for me?  Such a fix would > likely benefit many people.  If no one can, could someone tell me if > there are any other programs that can make an exe from a Ruby file? > > Thank you VERY much! > -- > Posted viahttp://www.ruby-forum.com/. Since you are working with Windows I then look into 'ocra' this is a very good alternate to rubyscript2exe. It works with the latest ruby interpretrs. Hope this helps