I am trying to install ncurses for ruby on windows. I have not installed ncurses before on my machine. I thought that having the \"ruby devkit\", it had asked for would be e
I've managed to do it for ruby 2.2, which doesn't come with curses by default, but it took me a while:
ruby -e 'puts $:'
might help;gem instal curses
. If the previous step was wrong, this will fail;This method didn't work for other gems, like ffi-ncurses. Tip: most of curses functionality comes from the Window class, which comes with curses by default.
The ruby ncurses gem requires that ncurses in installed on the machine. As far as I know ncurses has not been ported to windows. So I don't think you are going to get this to work.
There may be other ways to find out how wide the screen is on windows but I can't help you with that.
Update: It seems like SourceForge no longer hosts NCurses binaries for Windows. This answer is effectively obsolete now. Sorry! (As of August 2015, the GNU NCurses Page lists a "new" v6.0 release, which is newer than the 0.9.1 version in my answer.)
I finally got this to work (years after I needed it ...) without Cygwin, PDCurses, or manually building the NCurses source. The instructions are available on my blog. For reference:
ruby -e 'puts $:'
It works. Without PDCurses!
As of February 2020 (and possibly earlier) you can install the ncurses lib with
gem install curses
It works without any problems, at least on Ruby 2.6.5
When gem installed needs for curses lib; so at first you need to install NCurses with your msys2
https://sourceforge.net/p/mingw-w64/wiki2/NCurses/
Download NCurses (v5.9 at the time of writing): http://ftp.gnu.org/pub/gnu/ncurses/ in the source directory
Then untar and in the MSYS shell:
./configure --host=x86_64-w64-mingw32 --enable-term-driver --enable-sp-funcs --prefix=/some/prefix
make
make check
make install
then as mentioned in the link : https://github.com/ruby/curses/issues/13
use --platform=ruby ,--with-curses-include ,--with-curses-lib flags with gem install
Updated version:
gem install curses --platform=ruby -- --with-ncurses-dir="C:\ncurses"
C:\ncurses can be any directory