Open swolfekabaminc opened 9 years ago
Can confirm, having the same issues.
The method didn’t move (still defined on Unirest
module).
I just tested this and can’t reproduce the error. Also the tests are passing and the Unirest.user_agent
method is being tested.
Are you using the latest version (currently 1.1.2
) ?
Same problem here: NoMethodError: undefined method `user_agent' for Unirest:Module
Unirest.methods.sort gives (user_agent nowhere to be seen): => [:!, :!=, :!~, :<, :<=, :<=>, :==, :===, :=~, :>, :>=, :id, :send, :ancestors, :autoload, :autoload?, :class, :class_eval, :class_exec, :class_variable_defined?, :class_variable_get, :class_variable_set, :class_variables, :clear_default_headers, :clone, :const_defined?, :const_get, :const_missing, :const_set, :constants, :default_header, :define_singleton_method, :delete, :display, :dup, :enum_for, :eql?, :equal?, :extend, :freeze, :frozen?, :get, :hash, :include?, :included_modules, :inspect, :instance_eval, :instance_exec, :instance_method, :instance_methods, :instance_of?, :instance_variable_defined?, :instance_variable_get, :instance_variable_set, :instance_variables, :is_a?, :kind_of?, :method, :method_defined?, :methods, :module_eval, :module_exec, :name, :nil?, :object_id, :patch, :post, :private_class_method, :private_constant, :private_instance_methods, :private_method_defined?, :private_methods, :protected_instance_methods, :protected_method_defined?, :protected_methods, :public_class_method, :public_constant, :public_instance_method, :public_instance_methods, :public_method, :public_method_defined?, :public_methods, :public_send, :put, :remove_class_variable, :remove_instance_variable, :respond_to?, :send, :singleton_class, :singleton_methods, :taint, :tainted?, :tap, :timeout, :to_enum, :to_json, :to_s, :trust, :untaint, :untrust, :untrusted?]
gem install gives: Successfully installed unirest-1.1.2
Ruby version: ruby 2.0.0p598 (2014-11-13 revision 48408) [x86_64-darwin14.0.0]
+1
I think I found the problem. Looks like Unirest.user_agent
is only implemented in the master branch here on GitHub but is not published to Rubygems.
@ahmadnassri can you please bump the version and publish that?
Thank you.
+1
irb(main):003:0> require 'unirest'
irb(main):004:0> Unirest.user_agent
NoMethodError: undefined method `user_agent' for Unirest:Module
from (irb):4
from /usr/bin/irb:12:in `<main>'
+1
Can a new rubygems version be released please? It is not ideal to have github: 'Mashape/unirest-ruby'
in my Gemfile.
looks like the method has moved to the HttpClient class.
Documentation says it can be used as Unirest.user_agent('foobar') but I'm getting the error above.