Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing ncurses for ruby on Windows

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 enough, but now I am being asked to specify options... I don't know which options to pick, or if I need to do/install other things for the gem to get installed:

C:\Ruby193\Devkit>gem install ncurses -- --ruby=C:/Ruby193/bin/ruby --without-make-prog --without-opt-dir
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing ncurses:
        ERROR: Failed to build gem native extension.

        C:/Ruby193/bin/ruby.exe extconf.rb --ruby=C:/Ruby193/bin/ruby --without-make-prog --without-opt-dir
C:/Ruby193/lib/ruby/1.9.1/shellwords.rb:35:in `shellsplit': undefined method `scan' for false:FalseClass (NoMethodError)
        from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:2216:in `<top (required)>'
        from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from extconf.rb:22:in `<main>'


Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/ncurses-0.9.1 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/ncurses-0.9.1/./gem_make.out

WHAT A PAIN, I just want to get this gem installed so I can run this:

require 'curses'
cols = Curses.stdscr.maxx
msg = "random_string"
str = msg.center(msg.length + cols - msg.length - 5 - 3)
puts "<!-- #{str}-->"
like image 543
Flethuseo Avatar asked Nov 12 '22 20:11

Flethuseo


1 Answers

Updated version:

  1. Get ncurses (MinGW Port): http://invisible-island.net/ncurses/
  2. Put it in C:\ncurses
  3. gem install curses --platform=ruby -- --with-ncurses-dir="C:\ncurses"
  4. Copy the contents of C:\ncurses\bin to somewhere in your path

C:\ncurses can be any directory

like image 190
asdffdsa Avatar answered Dec 11 '22 12:12

asdffdsa