Exception with no 'to_query' method

I try to install Ruby Bossman and the following exception occurs:

/opt/local/lib/ruby/gems/1.8/gems/bossman-0.4.1/lib/bossman/boss.rb:10:in `initialize': undefined method `to_query' for #<Hash:0x1010f0800> (NoMethodError)
    from /opt/local/lib/ruby/gems/1.8/gems/bossman-0.4.1/lib/bossman/search.rb:12:in `new'
    from /opt/local/lib/ruby/gems/1.8/gems/bossman-0.4.1/lib/bossman/search.rb:12:in `method_missing'
    from es.rb:12

any idea? thank

+3
source share
1 answer

The problem arises because Hash outside of Rails does not have a to_query method.

I changed the code in

/opt/local/lib/ruby/gems/1.8/gems/bossman-0.4.1/lib/bossman/boss.rb

changing the line:

@uri.query = @options.to_query

in it:

@uri.query = URI.encode_www_form(@options)
+3
source

Source: https://habr.com/ru/post/1771295/


All Articles