frozen string

Discussion in 'Ruby' started by David Coffield, May 27, 2009.

  1. Hi,

    Am trying to get rubyscript2exe to work and get the error shown below.

    I've read the posts about this before (changing a line rubyscript2exe
    etc) but none of the answers work for me. Can someone suggest what I'm
    doing wrong? New to Ruby, by the way...

    D:\rubyplay>ruby -v
    ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]

    D:\rubyplay>helloworld.rb
    Hello World!

    D:\rubyplay>ruby rubyscript2exe-0.5.3.rb helloworld.rb
    rubyscript2exe-0.5.3.rb:621:in `replace': can't modify frozen string
    (TypeError)
    from rubyscript2exe-0.5.3.rb:621
    from rubyscript2exe-0.5.3.rb:577:in `newlocation'
    from rubyscript2exe-0.5.3.rb:505:in `newlocation'
    from rubyscript2exe-0.5.3.rb:472:in `newlocation'
    from rubyscript2exe-0.5.3.rb:505:in `newlocation'
    from rubyscript2exe-0.5.3.rb:577:in `newlocation'
    from rubyscript2exe-0.5.3.rb:619

    Many thanks,
    Rowantree
    --
    Posted via http://www.ruby-forum.com/.
     
    David Coffield, May 27, 2009
    #1
    1. Advertising

  2. Look at rubyscript2exe-0.5.3.rb line 612 perhaps?

    At a guess, maybe it's doing something with $0. At some stage after
    1.8.6p114, $0 was changed from a regular string to a frozen string. If
    that's your problem, try changing

    $0.replace("foo")

    to

    $0 = "foo"
    --
    Posted via http://www.ruby-forum.com/.
     
    Brian Candler, May 27, 2009
    #2
    1. Advertising

  3. Brian Candler wrote:
    > Look at rubyscript2exe-0.5.3.rb line 612 perhaps?
    >
    > At a guess, maybe it's doing something with $0. At some stage after
    > 1.8.6p114, $0 was changed from a regular string to a frozen string. If
    > that's your problem, try changing
    >
    > $0.replace("foo")
    >
    > to
    >
    > $0 = "foo"


    Hi,

    No... 'twasn't that unfortunately... thanks though.

    Cheers,
    David
    --
    Posted via http://www.ruby-forum.com/.
     
    David Coffield, May 27, 2009
    #3
    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. Jeff Groves
    Replies:
    0
    Views:
    739
    Jeff Groves
    Mar 3, 2007
  2. est
    Replies:
    1
    Views:
    596
  3. LC Geldenhuys
    Replies:
    5
    Views:
    281
    Robert Klemme
    Feb 18, 2004
  4. Peña, Botp
    Replies:
    2
    Views:
    190
    Peña, Botp
    May 31, 2007
  5. Une Bévue
    Replies:
    3
    Views:
    209
    Une Bévue
    Apr 25, 2010
Loading...

Share This Page