fcoury / octopi

A Ruby interface to GitHub API v2
http://hasmany.info/2009/4/18/ruby-interface-to-github-api
MIT License
216 stars 47 forks source link

in `save': undefined method `each' for nil:NilClass (NoMethodError) #66

Open gutenye opened 13 years ago

gutenye commented 13 years ago

code

authenticated do 
  repo = Repository.find(:name => "learn_ibus", :user => "gutenye")
  repo.description="hello"
  repo.save
end

error

/usr/lib/ruby/gems/1.9.1/gems/octopi-0.4.4/lib/octopi/base.rb:47:in `save': undefined method `each' for nil:NilClass (NoMethodError)
from /home/guten/a/a.rb:13:in `block in <main>'
from /usr/lib/ruby/gems/1.9.1/gems/octopi-0.4.4/lib/octopi.rb:36:in `block in authenticated'
from /usr/lib/ruby/gems/1.9.1/gems/octopi-0.4.4/lib/octopi.rb:65:in `authenticated_with'
from /usr/lib/ruby/gems/1.9.1/gems/octopi-0.4.4/lib/octopi.rb:35:in `authenticated'
from /home/guten/a/a.rb:9:in `<main>'

@keys is always nil

$ grep -R '@keys' /usr/lib/ruby/gems/1.9.1/gems/octopi-0.4.4/lib/  
/usr/lib/ruby/gems/1.9.1/gems/octopi-0.4.4/lib/octopi/base.rb:      @keys.each { |k| hash[k] = send(k) }