require ''rubygems'' require ''hpricot'' require ''open-uri'' doc = Hpricot(open("http://graph.facebook.com/226723089703")) @doc = doc.to_s.gsub(/"id.+?likes":/,"").gsub("{","").gsub("}","") puts @doc OR require ''rubygems'' require ''nokogiri'' require ''open-uri'' # Get a Nokogiri::HTML:Document for the page we’re interested in... doc = Nokogiri::HTML(open(''https://graph.facebook.com/19292868552'')) puts doc These two .rb files working fine on my local but giving error " Invalid argument - http://graph.facebook.com/19292868552 (Errno::EINVAL)" On Server if i remove line require ''open-uri'' on my local error comes again on local Any Idea ? Thanks in Advance .. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
rajeevsharma86
2011-Jan-06 07:19 UTC
Re: Invalid argument - https://graph.facebook.com/19292868552
May be a issue with open-uri Is some one face this error on server On Thu, Jan 6, 2011 at 12:46 PM, ashu <rajeevsharma86-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> require ''rubygems'' > require ''hpricot'' > require ''open-uri'' > doc = Hpricot(open("http://graph.facebook.com/226723089703")) > @doc = doc.to_s.gsub(/"id.+?likes":/,"").gsub("{","").gsub("}","") > puts @doc > OR > require ''rubygems'' > require ''nokogiri'' > require ''open-uri'' > # Get a Nokogiri::HTML:Document for the page we’re interested in... > doc = Nokogiri::HTML(open(''https://graph.facebook.com/19292868552''<https://graph.facebook.com/19292868552%27> > )) > puts doc > > These two .rb files working fine on my local but giving error > " Invalid argument - http://graph.facebook.com/19292868552 > (Errno::EINVAL)" On Server > if i remove line require ''open-uri'' on my local error comes again on > local > > Any Idea ? > Thanks in Advance ..-- Thanks: Rajeev sharma -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.