rubyscript2exe problem

J

Jim Mahony

Hi all,

This is my first post so forgive me if step on any forum conventions.
I'm not a programmer in any real sense - I just like playing around.
However I've managed to build an app that helps me do my work. Other
people in my workplace have now expressed interest in using the app.

I'm trying to convert the ruby app to .exe using the rubyscript2exe gem.

everytime I try I get this:

C:/Ruby/lib/ruby/gems/1.8/gems/rubyscript2exe-0.5.3/bin/rubyscript2exe:5:in
`replace': can't modify frozen string (TypeError)
from
C:/Ruby/lib/ruby/gems/1.8/gems/rubyscript2exe-0.5.3/bin/rubyscript2exe:5
from C:/Ruby/bin/rubyscript2exe:19:in `load'
from C:/Ruby/bin/rubyscript2exe:19


The command I run is: rubyscript2exe application.rb
I'm running this from command prompt whilst in the directory containing
the .rb file.

tried updating all gems, completely reinstalling Ruby to the most recent
installation and still have this problem.

I'm assuming that this is caused by some simple oversight. Any
suggestions would be greatly appreciated. :)
 
J

Jim Mahony

S

Saji N. Hameed

* Jim Mahony said:
I have already tried the solution in the first link (see above where I
mention that I have tried a complete reinstall of Ruby) as well as all
others that I could find on google but thanks very much for your helpful
response.

I'm only asking for help because I've been unable to find a solution
that worked after several hours of trying.

Hope you tried the one mentioned at

http://rha7dotcom.blogspot.com/2008/09/rubyscript2exerb-and-623-cant-modify.html


Meanwhile it may also be worthwhile to check out crate for your
packaging needs (see below)

saji
---

From: Jeremy Hinegardner <[email protected]>
Subject: [ANN] crate 0.1.1 Released
To: ruby-talk ML <[email protected]>
Reply-To: (e-mail address removed)
Mail-Followup-To: Ruby Talk <[email protected]>
Date: Tue, 2 Dec 2008 02:12:02 +0900
User-Agent: Mutt/1.5.16 (2007-06-09)
Message-Id: <[email protected]>


I'm pleased to announce that Crate, the project I spoke on at RubyConf
this year, has reached a releasable stage.

gem install crate

Crate is a tool to help package up your application as a custom static
build of the ruby interpreter plus all dependant binary extensions.
All the pure ruby code (the ruby application, the ruby stdlib, etc) is
packed into one or more SQLite databases.

The final distributable pieces are a single executable and a few SQLite
databases which can be then wrapped up appropriately as an OS X App; a
self extracting executable for Windows; a shar archive, rpm or tarball
for Unixes.

Project: http://copiousfreetime.rubyforge.org/crate/
Tutorial: http://copiousfreetime.org/articles/2008/11/30/package-an-application-
with-crate.html


--
Saji N. Hameed

APEC Climate Center +82 51 668 7470
National Pension Corporation Busan Building 12F
Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 (e-mail address removed)
KOREA
 
M

Mew Shew

Saji said:
Hope you tried the one mentioned at

http://rha7dotcom.blogspot.com/2008/09/rubyscript2exerb-and-623-cant-modify.html


Meanwhile it may also be worthwhile to check out crate for your
packaging needs (see below)

saji

Hi Saji

Thanks for the response.

Yes I have tried the solution in the link and it didn't make any
noticable difference (the actual line it refers to wasn't exactly where
the solution says it's supposed to be so I figure its refering to an
older version - i tried the fix regardless).

As for Crate - thanks for the tip. I'll give it a go. :)
 
J

Jeremy Hinegardner

Hi Saji

Thanks for the response.

Yes I have tried the solution in the link and it didn't make any
noticable difference (the actual line it refers to wasn't exactly where
the solution says it's supposed to be so I figure its refering to an
older version - i tried the fix regardless).

As for Crate - thanks for the tip. I'll give it a go. :)

This sounds like a perfect opportunity to use crate on windows. Please let me
know how I can help, I have yet to distribute a windows application with it.
And I want to make sure windows is supported, feel free to contact me on or off
list and we can get you up and running.

enjoy,

-jeremy
 
M

Mew Shew

Jeremy said:
This sounds like a perfect opportunity to use crate on windows. Please
let me
know how I can help, I have yet to distribute a windows application with
it.
And I want to make sure windows is supported, feel free to contact me on
or off
list and we can get you up and running.

enjoy,

-jeremy

Hey Jeremy,

Thanks very much for the response. I thought your name looked familiar.
I've been reading through the crate tutorial on your website.

I extremely keen to get my app working as a self-contained executable
but have so far been unsucessful. I followed your tutorial and hit a
problem quite early. See below:

C:\>gem install crate
Successfully installed crate-0.1.1
1 gem installed
Installing ri documentation for crate-0.1.1...
Installing RDoc documentation for crate-0.1.1...

C:\>crate -v
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require': no such file to load -- logging (LoadError)
from
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from C:/Ruby/lib/ruby/gems/1.8/gems/crate-0.1.1/lib/crate.rb:7
from
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from
C:/Ruby/lib/ruby/gems/1.8/gems/crate-0.1.1/lib/crate/main.rb:1
from
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from C:/Ruby/lib/ruby/gems/1.8/gems/crate-0.1.1/bin/crate:7
from C:/Ruby/bin/crate:19:in `load'
from C:/Ruby/bin/crate:19

C:\>

I can't help but get the impression that there is something that I'm
doing wrong or something wrong with my installation (though I have
reinstalled Ruby and all gems with the same result).

If you can provide any insight or assistence it would be greatly
appreciated. :)
 
T

The Higgs bozo

Mew said:
I have already tried the solution in the first link (see above where I
mention that I have tried a complete reinstall of Ruby)

You said that you installed "to the most recent installation", but the
first link suggests not using the most recent. Are you sure you tried
ruby186-26.exe? Your error is exactly the same as the one myself and
others had, which was solved by going back to that version.
 
J

Jeremy Hinegardner

Hey Jeremy,

Thanks very much for the response. I thought your name looked familiar.
I've been reading through the crate tutorial on your website.

I extremely keen to get my app working as a self-contained executable
but have so far been unsucessful. I followed your tutorial and hit a
problem quite early. See below:

C:\>gem install crate
Successfully installed crate-0.1.1
1 gem installed
Installing ri documentation for crate-0.1.1...
Installing RDoc documentation for crate-0.1.1...

C:\>crate -v
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require': no such file to load -- logging (LoadError)
from
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from C:/Ruby/lib/ruby/gems/1.8/gems/crate-0.1.1/lib/crate.rb:7
from
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from
C:/Ruby/lib/ruby/gems/1.8/gems/crate-0.1.1/lib/crate/main.rb:1
from
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from C:/Ruby/lib/ruby/gems/1.8/gems/crate-0.1.1/bin/crate:7
from C:/Ruby/bin/crate:19:in `load'
from C:/Ruby/bin/crate:19

C:\>

I can't help but get the impression that there is something that I'm
doing wrong or something wrong with my installation (though I have
reinstalled Ruby and all gems with the same result).

If you can provide any insight or assistence it would be greatly
appreciated. :)

No, this is my mistake, I forgot to include logging as a gem dependency.
if you run 'gem install logging' then this error will clear up. I'll push a new
version of crate out by monday that has this fix in it.

enjoy,

-jeremy
 
M

Mew Shew

The said:
You said that you installed "to the most recent installation", but the
first link suggests not using the most recent. Are you sure you tried
ruby186-26.exe? Your error is exactly the same as the one myself and
others had, which was solved by going back to that version.

I realised that the version of Ruby on my home PC was ruby186-26, tried
it out and it worked. Thanks a bunch.
 
J

James Cowlishaw

The said:

This fix is not reliable; assignment to $0 doesn't reallocate it's
buffer, hence the new string may be truncated.

Try this in a file test.rb:

10.times do
$0 = $0 + "."
puts "#{$0} (#{$0.size})"
end

You'll see the output:
ruby test.rb
test.rb. (8)
test.rb.. (9)
test.rb... (10)
test.rb.... (11)
test.rb.... (11)
test.rb.... (11)
test.rb.... (11)
test.rb.... (11)
test.rb.... (11)
test.rb.... (11)
Exit code: 0

The fix is to alias $0:

$progname = $0
alias $PROGRAM_NAME $0
alias $0 $progname

10.times do
$0 = $0 + "."
puts "#{$0} (#{$0.size})"
end

The output is then correct:
ruby test.rb
test.rb. (8)
test.rb.. (9)
test.rb... (10)
test.rb.... (11)
test.rb..... (12)
test.rb...... (13)
test.rb....... (14)
test.rb........ (15)
test.rb......... (16)
test.rb.......... (17)
Exit code: 0


See http://github.com/cowlibob/rubyscript2exe for the complete fixed
script.

Cowlibob.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top