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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ae92d2cb3e0fa6333040c6ca4571a538?d=identicon&s=25 Bartlomiej Owczarek (Guest)
on 2009-03-29 19:52
(Received via mailing list)
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.
Aaca034456897ccbc8bb14953c4a41c1?d=identicon&s=25 Radosław Bułat (radarek)
on 2009-03-29 20:30
(Received via mailing list)
Does ruby -e "puts 'hello worl'" give you the same error?

--
Pozdrawiam

Rados³aw Bu³at
http://radarek.jogger.pl - mój blog
C5eecd44fa818c7985d4f31bc2c42ac9?d=identicon&s=25 Eric Jacoboni (Guest)
on 2009-03-29 20:36
(Received via mailing list)
Bartlomiej Owczarek <bartlomiej@owczarek.com.pl> writes:


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


Could it be possible to see x.rb contents?
Ae92d2cb3e0fa6333040c6ca4571a538?d=identicon&s=25 Bartlomiej Owczarek (Guest)
on 2009-03-29 22:30
(Received via mailing list)
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!"
C5eecd44fa818c7985d4f31bc2c42ac9?d=identicon&s=25 Eric Jacoboni (Guest)
on 2009-03-29 22:40
(Received via mailing list)
Bartlomiej Owczarek <bartlomiej@owczarek.com.pl> 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
Ae92d2cb3e0fa6333040c6ca4571a538?d=identicon&s=25 Bartlomiej Owczarek (Guest)
on 2009-03-29 22:54
(Received via mailing list)
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
C5eecd44fa818c7985d4f31bc2c42ac9?d=identicon&s=25 Eric Jacoboni (Guest)
on 2009-03-29 23:10
(Received via mailing list)
Bartlomiej Owczarek <bartlomiej@owczarek.com.pl> 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).
Ae92d2cb3e0fa6333040c6ca4571a538?d=identicon&s=25 Bartlomiej Owczarek (Guest)
on 2009-03-29 23:58
(Received via mailing list)
On Sun, Mar 29, 2009 at 11:09 PM, Eric Jacoboni <jaco@neottia.net>
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:(
C5eecd44fa818c7985d4f31bc2c42ac9?d=identicon&s=25 Eric Jacoboni (Guest)
on 2009-03-30 00:10
(Received via mailing list)
Bartlomiej Owczarek <bartlomiej@owczarek.com.pl> 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. ?
Ae92d2cb3e0fa6333040c6ca4571a538?d=identicon&s=25 Bartlomiej Owczarek (Guest)
on 2009-03-30 00:38
(Received via mailing list)
On Mon, Mar 30, 2009 at 12:09 AM, Eric Jacoboni <jaco@neottia.net>
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?
C5eecd44fa818c7985d4f31bc2c42ac9?d=identicon&s=25 Eric Jacoboni (Guest)
on 2009-03-30 01:05
(Received via mailing list)
Bartlomiej Owczarek <bartlomiej@owczarek.com.pl> 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
Fbb4d027695dfdf76bf448b15d7e306a?d=identicon&s=25 matt neuburg (Guest)
on 2009-03-30 04:20
(Received via mailing list)
Eric Jacoboni <jaco@neottia.net> wrote:

> 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

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.
C5eecd44fa818c7985d4f31bc2c42ac9?d=identicon&s=25 Eric Jacoboni (Guest)
on 2009-03-30 11:38
(Received via mailing list)
matt@tidbits.com (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.
This topic is locked and can not be replied to.