ruby / curses

Ruby binding for curses, ncurses, and PDCurses. Formerly part of the ruby standard library.
Other
294 stars 34 forks source link

Curses versus Ncurses confusion #63

Closed rubyFeedback closed 3 years ago

rubyFeedback commented 3 years ago

I tried this:

gem install ncurses

The output was that:

"Fetching ncurses-0.9.1.gem ERROR: Error installing ncurses:

has an invalid specification_version

"

So first I thought this was the curses gem here, but I believe this is another gem.

Perhaps the main README could mention this? I was about to report the above but then I realized that the name is "curses" rather than "ncurses". A bit confusing to me; I made the incorrect assumption that ncurses would be curses and vice versa.

shugo commented 3 years ago

There are other gems such as ncurses-ruby and ncursesw, but I wouldn't like to list all gems in README.

I think the gem version badge in README and the homepage attribute of the curses gem are sufficient.

unurgunite commented 1 year ago

I know that this issue is old and has been closed several years ago but I came across this solution: just download the ncurses gem from https://rubygems.org/gems/ncurses via Download button or just type wget https://rubygems.org/downloads/ncurses-0.9.1.gem, then write gem unpack ncurses-0.9.1.gem, cd to unarchived folder of gem and create .gemspec file in project root with following content:

# frozen_string_literal: true

Gem::Specification.new do |s|
  s.name        = 'ncurses'
  s.version     = '0.9.1'
  s.licenses    = ['MIT']
  s.summary     = 'This is an example!'
  s.description = 'Much longer explanation of the example!'
  s.authors     = ['Ruby Coder']
  s.email       = 'rubycoder@example.com'
  s.files       = ['lib/ncurses.rb']
  s.homepage    = 'https://rubygems.org/gems/example'
  s.metadata    = { 'source_code_uri' => 'https://github.com/example/example' }
end

You can also edit all of this metatags if you want. Then do gem build .gemspec && gem install ncurses-0.9.1.gem

I know that ncurses gem is deprecated and replaced by ncurses-ruby gem (luckily, there is the same author for both gems), so this info is just for scientific interest or "just for fun". I think that the issue is in RubyGems utility: first releases of gem didn't check for some values of .gemspec file, but now it does, so RubyGems version < 2.x will install this gem without any errors, so this case is better suited for legacy versions of Ruby (1.8-2.0)