Ruby 1.9, OS X, command line: negative string size (ArgumentError)

Discussion in 'Ruby' started by Bartlomiej Owczarek, Mar 29, 2009.

  1. [Note: parts of this message were removed to make it a legal post.]

    Hello,

    I'd like to get Ruby 1.9 working on OS X 10.5.6, but so far I get the
    following error when trying to invoke any script:

    $ ruby -v
    ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-darwin9.6.0]

    $ ruby x.rb
    ruby: negative string size (or size too big) (ArgumentError)

    I tried two approaches to install ruby:

    1) through ports

    2) compiling with the following configure:

    /configure --prefix=/Users/user1/dev/ruby19 --enable-shared --with-
    readline-dir=/usr/local

    Both yield the same result.

    I couldn't find similar case online, can anyone help?

    Bests,

    /B.
     
    Bartlomiej Owczarek, Mar 29, 2009
    #1
    1. Advertising

  2. Re: Ruby 1.9, OS X, command line: negative string size(ArgumentError)

    Does ruby -e "puts 'hello worl'" give you the same error?

    --=20
    Pozdrawiam

    Rados=B3aw Bu=B3at
    http://radarek.jogger.pl - m=F3j blog
     
    Rados³aw Bu³at, Mar 29, 2009
    #2
    1. Advertising

  3. Bartlomiej Owczarek <> writes:


    > $ ruby x.rb
    > ruby: negative string size (or size too big) (ArgumentError)



    Could it be possible to see x.rb contents?
     
    Eric Jacoboni, Mar 29, 2009
    #3
  4. Re: Ruby 1.9, OS X, command line: negative string size(ArgumentError)

    [Note: parts of this message were removed to make it a legal post.]

    Hello, in response to your questions:

    $ ruby -v
    ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-darwin9.6.0]

    $ ruby -e "puts 'hello worl'"
    ruby: negative string size (or size too big) (ArgumentError)

    $ more x.rb
    puts "hey!"





    On Sun, Mar 29, 2009 at 8:34 PM, Eric Jacoboni <> wrote:

    > Bartlomiej Owczarek <> writes:
    >
    >
    > > $ ruby x.rb
    > > ruby: negative string size (or size too big) (ArgumentError)

    >
    >
    > Could it be possible to see x.rb contents?
    >
    >



    --
    Bartlomiej Owczarek
    Mob. +48 607 102 128
    http://www.owczarek.com.pl
     
    Bartlomiej Owczarek, Mar 29, 2009
    #4
  5. Bartlomiej Owczarek <> writes:

    > $ more x.rb
    > puts "hey!"


    I've installed Ruby 1.9 via MacPorts (MacBook Pro and 10.5.6), and it runs ok:

    % ruby1.9 -v
    ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-darwin9]
    % ruby1.9 -e "puts 'hello world'"
    hello world
     
    Eric Jacoboni, Mar 29, 2009
    #5
  6. Re: Ruby 1.9, OS X, command line: negative string size(ArgumentError)

    [Note: parts of this message were removed to make it a legal post.]

    Actually the mac ports ruby gives me a different version:

    $ ruby1.9 -v
    ruby 1.9.0 (2008-07-25 revision 18217) [i686-darwin9]

    Maybe I have a wrong package? I installed it today with:

    $ sudo port install ruby19

    Anyways the error is the same as with ruby which I compiled myself, even
    though it introduces itself as revision 21907



    On Sun, Mar 29, 2009 at 10:39 PM, Eric Jacoboni <> wrote:

    > Bartlomiej Owczarek <> writes:
    >
    > > $ more x.rb
    > > puts "hey!"

    >
    > I've installed Ruby 1.9 via MacPorts (MacBook Pro and 10.5.6), and it runs
    > ok:
    >
    > % ruby1.9 -v
    > ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-darwin9]
    > % ruby1.9 -e "puts 'hello world'"
    > hello world
    >
    >
    >
     
    Bartlomiej Owczarek, Mar 29, 2009
    #6
  7. Bartlomiej Owczarek <> writes:


    > $ ruby1.9 -v
    > ruby 1.9.0 (2008-07-25 revision 18217) [i686-darwin9]
    >
    > Maybe I have a wrong package? I installed it today with:
    >
    > $ sudo port install ruby19


    I suggest:

    1) sudo port selfupdate
    2) sudo port upgrade ruby19

    (and, maybe, "port outdated" if you're using other ports).
     
    Eric Jacoboni, Mar 29, 2009
    #7
  8. Re: Ruby 1.9, OS X, command line: negative string size(ArgumentError)

    [Note: parts of this message were removed to make it a legal post.]

    On Sun, Mar 29, 2009 at 11:09 PM, Eric Jacoboni <> wrote:

    > I suggest:
    >
    > 1) sudo port selfupdate
    > 2) sudo port upgrade ruby19
    >
    > (and, maybe, "port outdated" if you're using other ports).
    >
    >

    1&2 succeded in bringing mac ports ruby to the same version:

    $ ruby1.9 -v
    ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-darwin9]

    Unfortunately the error remains:(
     
    Bartlomiej Owczarek, Mar 29, 2009
    #8
  9. Bartlomiej Owczarek <> writes:


    > $ ruby1.9 -v
    > ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-darwin9]
    >
    > Unfortunately the error remains:(


    What about you environment? encoding, lang, etc. ?
     
    Eric Jacoboni, Mar 29, 2009
    #9
  10. Re: Ruby 1.9, OS X, command line: negative string size(ArgumentError)

    [Note: parts of this message were removed to make it a legal post.]

    On Mon, Mar 30, 2009 at 12:09 AM, Eric Jacoboni <> wrote:

    >
    >
    > What about you environment? encoding, lang, etc. ?
    >


    Ok I found it

    $ export
    --cut--
    declare -x LC_CTYPE="UTF-8"

    $ export -n LC_CTYPE

    $ ruby -e "puts 'hello world'"
    hello world


    Deleting LC_CTYPE did it.

    That said I understand that this LC_CTYPE setting was there for a reason,
    presumably because my terminal is set to utf8, as it's supposed to be.

    So it's not clear for me why ruby would now have problem with that, and how
    to proceed - should the setting for utf8 be defined somehow differently?
     
    Bartlomiej Owczarek, Mar 29, 2009
    #10
  11. Bartlomiej Owczarek <> writes:


    > That said I understand that this LC_CTYPE setting was there for a reason,
    > presumably because my terminal is set to utf8, as it's supposed to be.
    >
    > So it's not clear for me why ruby would now have problem with that, and how
    > to proceed - should the setting for utf8 be defined somehow
    > differently?


    For my own, i don't rely on LC_* variables. I've only set LANG
    environment variable and pick UTF-8 in Terminal Preferences/Encoding
     
    Eric Jacoboni, Mar 30, 2009
    #11
  12. (matt neuburg) writes:

    > I've got that LC_CTYPE setting because of svn, which will choke on
    > certain files if it isn't there. I think the question of why Ruby 1.9
    > would have trouble with this is reasonable... m.


    Agree. Unfortunately, i have not the answer.
     
    Eric Jacoboni, Mar 30, 2009
    #12
    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. prem_eda
    Replies:
    5
    Views:
    7,990
    Pieter Hulshoff
    Oct 11, 2004
  2. Mikel Lindsaar
    Replies:
    0
    Views:
    523
    Mikel Lindsaar
    Mar 31, 2008
  3. Ittay Dror
    Replies:
    1
    Views:
    142
    Nobuyoshi Nakada
    Dec 7, 2008
  4. Smp Mp
    Replies:
    0
    Views:
    132
    Smp Mp
    Aug 23, 2010
  5. George

    command-line arg, negative hex?

    George, Mar 27, 2010, in forum: Perl Misc
    Replies:
    16
    Views:
    196
    sreservoir
    Mar 29, 2010
Loading...

Share This Page