wordnik/wordnik-ruby — Issue #2: NoMethodError: undefined method `upcase' for :get:Symbol
Author: muziejus
Created: 2011-12-10 16:46:21+00:00
State: open

I've had this error come up on two separate installs of this gem over the past 24 hrs, and I wasn't able to find any news about it.

Here's what it looks like in irb:

irb(main):007:0> randomword = Wordnik.words.get_random_word(:hasDictionaryDef => 'true')
NoMethodError: undefined method `upcase' for :get:Symbol
from ~/.gem/ruby/1.8/gems/wordnik-4.06.11/lib/wordnik/request.rb:153:in `make'
from ~/.gem/ruby/1.8/gems/wordnik-4.06.11/lib/wordnik/request.rb:164:in `response'
from ~/.gem/ruby/1.8/gems/wordnik-4.06.11/lib/wordnik/resource_modules/words.rb:291:in `get_random_word'
from (irb):7

Both times I was able to get rid of the error by changing:

Wordnik.logger.debug "\n #{self.http_method.upcase} #{self.url}\n body: #{self.outgoing_body}\n headers: #{request.headers}\n\n"

in request.rb to

Wordnik.logger.debug "\n #{self.http_method} #{self.url}\n body: #{self.outgoing_body}\n headers: #{request.headers}\n\n"

The gem is working on one machine (a Mac), but is still tripping up the other, but that seems to be typhoeus-related trouble.

Mac is running ruby 1.8.7 and gem 1.8.12. The other machine is running the same ruby, but gem 1.3.7