I’m trying to do this sample (third one): http://nntp.rubyforge.org/ as
follows:
[email protected]:~/ruby/nntp$
[email protected]:~/ruby/nntp$
[email protected]:~/ruby/nntp$ ruby nntp.rb
/home/thufir/.rvm/gems/ruby-1.9.3-p125/gems/nntp-1.0.0/lib/nntp.rb:400:in
do_start': private method
open’ called for
Net::InternetMessageIO:Class
(NoMethodError)
from /home/thufir/.rvm/gems/ruby-1.9.3-p125/gems/nntp-1.0.0/lib/
nntp.rb:380:in start' from /home/thufir/.rvm/gems/ruby-1.9.3-p125/gems/nntp-1.0.0/lib/ nntp.rb:321:in
start’
from nntp.rb:6:in `’
[email protected]:~/ruby/nntp$
[email protected]:~/ruby/nntp$ cat nntp.rb
require ‘rubygems’
require ‘nntp’
newsgroup = ‘gmane.comp.lang.ruby.general’
Net::NNTP.start(‘news.gmane.org’, 119) do |nntp|
message_ids = nntp.listgroup(newsgroup)
nntp.group(newsgroup)
message_ids[1].each do |id|
nntp.head(id).each do |header|
header.each { |line| puts(line) if line.index(‘Subject:’) }
end
end
end
[email protected]:~/ruby/nntp$
[email protected]:~/ruby/nntp$ type rvm | head -1
rvm is a function
[email protected]:~/ruby/nntp$
[email protected]:~/ruby/nntp$ rvm --version
rvm 1.10.3 by Wayne E. Seguin [email protected], Michal P.
[email protected] [https://rvm.beginrescueend.com/]
[email protected]:~/ruby/nntp$
[email protected]:~/ruby/nntp$ gem --version
1.8.19
[email protected]:~/ruby/nntp$
[email protected]:~/ruby/nntp$ ruby --version
ruby 1.9.3p125 (2012-02-16 revision 34643) [i686-linux]
[email protected]:~/ruby/nntp$
[email protected]:~/ruby/nntp$
[email protected]:~/ruby/nntp$ gem list --local | grep nntp
nntp (1.0.0)
ruby-net-nntp (1.0.0)
[email protected]:~/ruby/nntp$
now when I look at http://rubydoc.info/stdlib/net/1.9.2/Net/
InternetMessageIO I don’t even see method “open,” so was that method
removed from the class? Or, is there a problem with the sample code?
Or
my ruby install? Odd that sample code gives an error, like the library
is the problem.
thanks,
Thufir