Ruby on Rails Wednesday, January 5, 2011


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@gmail.com> 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'))
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@googlegroups.com.
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.

No comments:

Post a Comment