Ncurses-ruby install failing on OS X Snow Leopard

ncurses-ruby 1.2.4 is failing on Snow Leopard 10.6.3 (ruby 1.9.1). I am
downloading the tar file from berlios.de and doing the extconf+make
routine.

The problem has been documented elsewhere but no fix/solution.

ncurses_wrap.c: In function ‘rbncurshelper_nonblocking_wgetch’:
ncurses_wrap.c:818: error: dereferencing pointer to incomplete type
ncurses_wrap.c:835: error: dereferencing pointer to incomplete type
ncurses_wrap.c:854: error: dereferencing pointer to incomplete type
make: *** [ncurses_wrap.o] Error 1

I have tried installing elliottcable-ncurses. This installs but many of
its own examples don’t work. I get errors like

form.rb:21:in <main>': undefined method new_field’ for
Ncurses::Form:Module (NoMethodError)

I get similar failures when trying to run my application.

(Btw, my app has been working for a long time on 1.9.1 on OS X Leopard
PPC).

Help appreciated.

R. Kumar wrote:

ncurses-ruby 1.2.4 is failing on Snow Leopard 10.6.3 (ruby 1.9.1). I am
downloading the tar file from berlios.de and doing the extconf+make
routine.

I’ve found a work-around.

Download older ncurses-0.9.1.gem.

Make changes to lines that give error in ncurses_wrap.c as per the new
version 1.2.4.

Now it works.

There is also a link here which gives a patch file to make the change. I
have not tested out what this article says.
http://trickyco.de/tag/ncurses

** ncurses for ruby programmers seems to be in a sorry state with no one
maintaining the gem. **

I recommend ffi-ncurses.

On Apr 25, 2010 3:06 PM, “R. Kumar” [email protected] wrote:

R. Kumar wrote:

ncurses-ruby 1.2.4 is failing on Snow Leopard 10.6.3 (ruby 1.9.1). I am
download…
I’ve found a work-around.

Download older ncurses-0.9.1.gem.

Make changes to lines that give error in ncurses_wrap.c as per the new
version 1.2.4.

Now it works.

There is also a link here which gives a patch file to make the change. I
have not tested out what this article says.
http://trickyco.de/tag/ncurses

** ncurses for ruby programmers seems to be in a sorry state with no one
maintaining the gem. **

Michael F. wrote:

I recommend ffi-ncurses.

Michael,

Can you give me an idea:

  1. How complete is ffi-ncurses ?

  2. How much time would it take to port an app or library that uses
    ncurses.
    I know its hard for you to tell, but lets assume i have 99% of my
    ncurses calls in 2 or 3 classes. The rest of the app uses these classes.
    I use only Window, Panel, Pad, keyboard and color related stuff,
    delay/nodelay.

On Tue, Apr 27, 2010 at 1:23 PM, R. Kumar [email protected] wrote:

Michael F. wrote:

I recommend ffi-ncurses.

Michael,

Can you give me an idea:

  1. How complete is ffi-ncurses ?

It covers all the basic ncurses calls…

  1. How much time would it take to port an app or library that uses
    ncurses.
    I know its hard for you to tell, but lets assume i have 99% of my
    ncurses calls in 2 or 3 classes. The rest of the app uses these classes.
    I use only Window, Panel, Pad, keyboard and color related stuff,
    delay/nodelay.

I have no idea how long it would take, depends on how large and
complex the code is.
It should be pretty painless though.
The parts not in ffi-ncurses are Window and Panel, I wrote them if
you’d like to reuse them.

I’ll try to get them into ffi-ncurses sometime, I’m not even sure they
work with latest FFI without modification.
If you have any trouble, please let me know so we can work it out.

On Tue, Apr 27, 2010 at 12:43 PM, Michael F.
[email protected] wrote:

The parts not in ffi-ncurses are Window and Panel, I wrote them if
you’d like to reuse them.
ver/lib/ver/ncurses at bdfc4f1ae885b3635983d0db6f0b8fe1ebcca922 · manveru/ver · GitHub
I’ll try to get them into ffi-ncurses sometime, I’m not even sure they
work with latest FFI without modification.

hi Michael,
sean’s page mentions that he has no plans incorporating forms. That is
sad since it is the main reason i’d use ncurses. do you plan to
incorporate forms?

best regards -botp

Michael F. wrote:

I have no idea how long it would take, depends on how large and
complex the code is.
It should be pretty painless though.
The parts not in ffi-ncurses are Window and Panel, I wrote them if
you’d like to reuse them.
ver/lib/ver/ncurses at bdfc4f1ae885b3635983d0db6f0b8fe1ebcca922 · manveru/ver · GitHub
I’ll try to get them into ffi-ncurses sometime, I’m not even sure they
work with latest FFI without modification.
If you have any trouble, please let me know so we can work it out.

I already have everything working with Window and Panel and Pad for over
a year using ncurses. If you are using ncurses too then i would still be
tied down. I was thinking of completely moving to ffi if ncurses is
going to keep giving install problems.

What about speed. Is the performance the same ?

On Tue, Apr 27, 2010 at 4:51 PM, R. Kumar [email protected] wrote:

ncurses forms are fine for simple forms. But if you have a complex form
then there are too many limitations. One spends too much time working
around the limitations of ncurses. I spent months trying to get things
done using ncurses forms and fields before finally writing my own
version in ruby.

hi kumar, do you plan to release to public your own ncurses ruby forms?
best regards -botp

botp wrote:

hi Michael,
sean’s page mentions that he has no plans incorporating forms. That is
sad since it is the main reason i’d use ncurses. do you plan to
incorporate forms?

best regards -botp

ncurses forms are fine for simple forms. But if you have a complex form
then there are too many limitations. One spends too much time working
around the limitations of ncurses. I spent months trying to get things
done using ncurses forms and fields before finally writing my own
version in ruby.

Anyway, if its simple you can give ncurses form it a try.

botp wrote:

hi kumar, do you plan to release to public your own ncurses ruby forms?
best regards -botp

I meant, first give the forms and fields that is already available
with ncurses a try. If you find it useful then good. If you find
yourself struggling then you can give rbcurse a try.