I'm still new in ruby, please help. I'm trying to make a http request in my standalone ruby script.
#!/usr/bin/ruby
require 'rubygems'
require 'net/http'
...
class someClass
...
def get_ruby_doc
request = HttpRequest.new(:get, 'http://www.ruby-doc.org/')
response = request.perform!
puts response.succeeded?
puts "yeah"
end
...
when I run the script, I get this error:
Uncaught exception: uninitialized constant someClass::HttpRequest
Can you please let me know what did I miss? Thanks.
I also try to do the same in rails console, same error.
You could try using rest-client
http://rubydoc.info/gems/rest-client/1.6.7/frames