rkumar / rbcurse

ruby based curses widgets: fields, buttons, textarea. menus, message boxes, tabbed panes, tables, listboxes, splitpanes, scrollpanes. Event based, MVC architecture. (DEPRECATED - PLS USE rbcurse-core)
http://totalrecall.wordpress.com/
138 stars 13 forks source link

Can't run any of the examples - rwidget.rb:122: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n' (SyntaxError) #4

Closed oren closed 14 years ago

oren commented 14 years ago

my environment: ruby 1.9.1-p243, ubuntu 9.10, ncurses (1.2.4)

I get this error on any ruby file in examples folder. (the samples in ncurses gem works)

/opt/ruby-1.9.1-p243/lib/ruby/gems/1.9.1/gems/rbcurse-0.1.3/lib/rbcurse.rb:3:in require': /opt/ruby-1.9.1-p243/lib/ruby/gems/1.9.1/gems/rbcurse-0.1.3/lib/rbcurse/rwidget.rb:122: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n' (SyntaxError) /opt/ruby-1.9.1-p243/lib/ruby/gems/1.9.1/gems/rbcurse-0.1.3/lib/rbcurse/rwidget.rb:124: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n' from /opt/ruby-1.9.1-p243/lib/ruby/gems/1.9.1/gems/rbcurse-0.1.3/lib/rbcurse.rb:3:in<top (required)>' from test2.rb:6:in require' from test2.rb:6:in

'

Thanks!

rkumar commented 14 years ago

I suspect you are using a version of rbcurse that will only run on ruby 1.8. This seems to be the error message in a case statement which uses the 1.8 syntax.

If you are using ruby 1.9 please go to github download section and download a tar.gz file. And thanks for mentioning the ncurses-ruby samples work, that immediately removes one set of issues.

oren commented 14 years ago

i checkout the 1.9 branch, but not sure how to install your gem from source.. can you guide me?

thanks

rkumar commented 14 years ago

that's the sad part. There is a gem spec which only requires a rake command to build the gem, but the gem spec needs the exact files to include. I am told it is outdated. So many new files have been added that I would have to not only update the gem spec file but also test it out somehow to make sure nothing go missed. And being interpreted, not sure how much testing would reveal a missed file.

Is it possible to copy the files into the gem folder ? But i know in the long run i need to create a fresh gem and upload to gemcutter. The existing gems are too old.

oren commented 14 years ago

ok. i think i'll try to learn more about ffi, and try to integrate it with your code, whenever i'll see fit. I try to create a client for Redmine (the bug tracking part of it) I want to view/sort/update and add issues from a text-based client.

I believe that your testtodo.rb can be the basis for my app, so i'll see if i can integrate your code with ffi. thanks so much for this gem, and join #ruby-lang

rkumar commented 14 years ago
  1. Why do you want to integrate with ffi. Why not use ncurses ? Is there a requirement only to use ffi ?
  2. If you have to, do note that most ncurses calls are in the lib/ver/window.rb and ncurses.rb. You may also have to do a grep for "mvw" there may be one or 2 here or there,
  3. I have always wanted to know about this #ruby or #... What is it ? How does one join ? What does one do in it? How is it different from ruby-forum.org ? Is it an online chat ? I have googled IRC etc but i am still lost on what it is! Thanks.
oren commented 14 years ago
  1. no real reason - people on #ruby-lang told me it's better to use ffi
  2. i think i'll not use ffi since your library seems nicer. i'll try to dive into your code instead.
  3. yes. it's an irc chat. i'll be happy to help you. i'll send u a private message now.
rkumar commented 13 years ago

rbcurse works with all versions of ruby. i think the person who raised this was using an older gem that was written for 1.8.