rubyscript2exe problem

Discussion in 'Ruby' started by Jim Mahony, Dec 3, 2008.

  1. Jim Mahony

    Jim Mahony Guest

    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. :)
    --
    Posted via http://www.ruby-forum.com/.
     
    Jim Mahony, Dec 3, 2008
    #1
    1. Advertising

    1. Advertising

  2. Jim Mahony

    Jim Mahony Guest

    The Higgs bozo wrote:
    >
    > http://www.ruby-forum.com/topic/170355
    >
    > http://letmegooglethatforyou.com/?q=rubyscript2exe modify frozen string


    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.
    --
    Posted via http://www.ruby-forum.com/.
     
    Jim Mahony, Dec 3, 2008
    #3
  3. * Jim Mahony <> [2008-12-03 17:35:40 +0900]:

    > The Higgs bozo wrote:
    > >
    > > http://www.ruby-forum.com/topic/170355
    > >
    > > http://letmegooglethatforyou.com/?q=rubyscript2exe modify frozen string

    >
    > 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 <>
    Subject: [ANN] crate 0.1.1 Released
    To: ruby-talk ML <>
    Reply-To:
    Mail-Followup-To: Ruby Talk <>
    Date: Tue, 2 Dec 2008 02:12:02 +0900
    User-Agent: Mutt/1.5.16 (2007-06-09)
    Message-Id: <>


    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


    > --
    > Posted via http://www.ruby-forum.com/.
    >
    >


    --
    Saji N. Hameed

    APEC Climate Center +82 51 668 7470
    National Pension Corporation Busan Building 12F
    Yeonsan 2-dong, Yeonje-gu, BUSAN 611705
    KOREA
     
    Saji N. Hameed, Dec 3, 2008
    #4
  4. Jim Mahony

    Mew Shew Guest

    Saji N. Hameed wrote:
    > * Jim Mahony <> [2008-12-03 17:35:40 +0900]:
    >
    >>
    >> 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


    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. :)
    --
    Posted via http://www.ruby-forum.com/.
     
    Mew Shew, Dec 3, 2008
    #5
  5. On Wed, Dec 03, 2008 at 07:45:38PM +0900, Mew Shew wrote:
    > Saji N. Hameed wrote:
    > > * Jim Mahony <> [2008-12-03 17:35:40 +0900]:
    > >
    > >>
    > >> 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

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

    --
    ========================================================================
    Jeremy Hinegardner
     
    Jeremy Hinegardner, Dec 4, 2008
    #6
  6. Jim Mahony

    Mew Shew Guest

    Jeremy Hinegardner wrote:

    > 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. :)
    --
    Posted via http://www.ruby-forum.com/.
     
    Mew Shew, Dec 5, 2008
    #7
  7. Mew Shew wrote:
    > The Higgs bozo wrote:
    >>
    >> http://www.ruby-forum.com/topic/170355
    >>
    >> http://letmegooglethatforyou.com/?q=rubyscript2exe modify frozen string

    >
    > 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.
    --
    Posted via http://www.ruby-forum.com/.
     
    The Higgs bozo, Dec 5, 2008
    #8
  8. On Fri, Dec 05, 2008 at 01:35:03PM +0900, Mew Shew wrote:
    > Jeremy Hinegardner wrote:
    >
    > > 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. :)


    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

    --
    ========================================================================
    Jeremy Hinegardner
     
    Jeremy Hinegardner, Dec 6, 2008
    #9
  9. Jim Mahony

    Mew Shew Guest

    The Higgs bozo wrote:
    > Mew Shew wrote:
    >> The Higgs bozo wrote:
    >>>
    >>> http://www.ruby-forum.com/topic/170355
    >>>
    >>> http://letmegooglethatforyou.com/?q=rubyscript2exe modify frozen string

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


    I realised that the version of Ruby on my home PC was ruby186-26, tried
    it out and it worked. Thanks a bunch.
    --
    Posted via http://www.ruby-forum.com/.
     
    Mew Shew, Dec 6, 2008
    #10
  10. The Higgs bozo wrote:
    >
    > http://www.ruby-forum.com/topic/170355
    >
    > http://letmegooglethatforyou.com/?q=rubyscript2exe modify frozen string


    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.

    --
    Posted via http://www.ruby-forum.com/.
     
    James Cowlishaw, Jun 4, 2009
    #11
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. moinker

    rubyscript2exe problem

    moinker, Apr 10, 2006, in forum: Ruby
    Replies:
    6
    Views:
    117
    Erik Veenstra
    Apr 11, 2006
  2. Anselm (anonymous)

    rubyscript2exe problem (yes another)

    Anselm (anonymous), Dec 10, 2006, in forum: Ruby
    Replies:
    5
    Views:
    91
    Anselm (anonymous)
    Dec 10, 2006
  3. Daniel Berger
    Replies:
    1
    Views:
    109
    Daniel Berger
    Jun 27, 2007
  4. Brian Vernarsky

    Ruby/Tk and rubyscript2exe problem

    Brian Vernarsky, Aug 22, 2007, in forum: Ruby
    Replies:
    2
    Views:
    86
    Brian Vernarsky
    Aug 22, 2007
  5. Markus Hoffmann

    rubyscript2exe problem with Qt::File

    Markus Hoffmann, Apr 15, 2009, in forum: Ruby
    Replies:
    0
    Views:
    132
    Markus Hoffmann
    Apr 15, 2009
Loading...

Share This Page