The Accidental Rubyist

invalid byte sequence in UTF-8

Archive for August 2010

rbcurse broken in ruby 1.9.2 (new key hash iteration)

leave a comment »

Edit: I have fixed the following and uploaded to github. Will be testing all examples and then releasing version 1.1.4 soon.

Some issues are cropping up in 1.9.2.
Essentially, “can’t add a new key into hash during iteration” which apparently 1.9.1 should have been catching but did not.

Also, some examples are unable to load files that are within the examples directory. Currently, I have to put a “./” in the require. However, that means the example cannot be run from any other folder. (In ruby 1.9.2, current folder is no longer in “$:”.)

I shall work on the hash issue in the next week or so.

Written by totalrecall

August 22, 2010 at 2:41 pm

Posted in ruby

ncurses working with ruby 1.9.2 (Snow Leopard)

with 14 comments

Thanks to the comment on the previous post, and the folks on ruby-forum, I’ve managed to get the ncurses gem working on ruby 1.9.2. Some changes are required w.r.t. STR2CSTR. I’ve uploaded a gem here. I’ve named the gem ncurses-0.9.2.gem to avoid confusion with the existing 0.9.1. I hope it’s not illegal.

btw, not all examples of ncurses are working. Some are breaking due to changes in ruby 1.9.x, and some I don’t know. example.rb, rain.rb and hello_world are working.

Edit: Thanks to Ralf Papenkordt, ncurses 1.2.4 is now working on Snow Leopard. The gem and tarbz2 are available on github.

Update: You may also try:

gem install snowleopard-ncurses

Written by totalrecall

August 22, 2010 at 2:11 pm

Posted in ncurses, ruby

ncurses gem failing on Snow Leopard under ruby 1.9.2

with 2 comments

I have ncurses gem working fine under ruby 1.9.1 (after some fixing and patching).
However, i just installed ruby 1.9.2 using rvm. The stock “gem install ncurses” of course fails. Then I downloaded and installed ncurses-0.9.1. This also of course fails. I patched it and got it to install. However, all examples fail. Here’s what i get:

dyld: lazy symbol binding failed: Symbol not found: _STR2CSTR
Referenced from: /Users/rahul/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/x86_64-darwin10/ncurses.bundle
Expected in: flat namespace dyld:
Symbol not found: _STR2CSTR
Referenced from: /Users/rahul/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/x86_64-darwin10/ncurses.bundle
Expected in: flat namespace
Trace/BPT trap

I also copied the working ncurses gem from 1.9.1 (and installed it under 1.9.2) and that too gives the same runtime error.

EDIT: SOLVED Pls see https://totalrecall.wordpress.com/2010/08/22/ncurses-working-with-ruby-1-9-2-snow-leopard/

Written by totalrecall

August 20, 2010 at 11:05 pm

Posted in ncurses, ruby