vendredi 8 mai 2015

Ruby Error: koala no such file to load LoadError

I have installed Ruby (not Rails) on a machine and am trying to run some code based off the koala framework for Facebook.
When I run

    gem list

koala is mentioned but when I run the file, I get this error. Rubygems is already installed, I'm not sure what else to do. Any ideas?

Edit:

    require 'koala'
    require 'json'

    @graph = Koala::Facebook::API.new("CAACEdEose0cBANb7YuygrBflSkBrpdalb4e70T5lJgdLPYEh0Uxy5JLPVdukKSiwZAK8g27DnwscSUWNaC0s53ogq6h562LETjYO4sB5lZAMAy8tC0SM9UzqXkk7GKYpaLrkQlgj1oLTdOJhBfq5KJtFxZBkOkpz8HaVPLYp66OnuGkaGOogVseR1tUNXVxToKl6ZCmwHL0i5RHNvMnd")




    url = File.open("urls.txt","r")
    url.each_line do |line|
        id = /[\d]+/.match(line)
        begin
            temp = @graph.get_object(id)
            list = File.open("working.txt", "a")
            list.write(id)
            list.write("\n")
            puts "Worked for #{id}."
        rescue
            puts "Didn't work for #{id}."
        end      
    end 

Aucun commentaire:

Enregistrer un commentaire