Prev: TCPServer Muliple Clients by Name or Alias
Next: Dynamic insert of array data in mysql using DBI
From: Pen Ttt on 20 Jul 2010 01:00 would you mind to tell me how to fix it, to make the following program to run? require 'rubygems' require 'open-uri' url="www.123.com" open(url){|file| if url don't exists then puts "url don't exists" else puts "url exists"} thiks -- Posted via http://www.ruby-forum.com/.
From: Pen Ttt on 20 Jul 2010 03:32 irb(main):001:0> require 'rubygems' => true irb(main):002:0> require 'open-uri' => true irb(main):003:0> url = URI.parse('www.123.com') => #<URI::Generic:0xb764ff84 URL:www.123.com> irb(main):004:0> status = Net::HTTP.start(url.host, url.port) {|http| irb(main):005:1* http.head(url.path) irb(main):006:1> } NameError: uninitialized constant Net from (irb):4 from :0 irb(main):007:0> puts( /^2/ =~ status.code ? "ok" : "nok" ) NoMethodError: undefined method `code' for nil:NilClass from (irb):7 from :0 ?? -- Posted via http://www.ruby-forum.com/.
From: Jean-Julien Fleck on 20 Jul 2010 04:09 > NameError: uninitialized constant Net require 'net/http' -- JJ Fleck PCSI1 Lycée Kléber
|
Pages: 1 Prev: TCPServer Muliple Clients by Name or Alias Next: Dynamic insert of array data in mysql using DBI |