Could not find configuration information for secret

11 views
Skip to first unread message

Nathan Arnold

unread,
Jan 10, 2013, 12:04:41 PM1/10/13
to faceb...@googlegroups.com
Using Facebooker2
rails 2.3.10 
ruby 1.8.7

In my rails web app I can successfully log in to facebook via my facebook app and the facebooker2 gem. Hooray! So this means my yaml is being loaded correctly and all that jazz. Right?

However, when I attempt to post a status update, I get the following error:

Could not find configuration information for secret

Here's the code that attempts the status_update (/lib/facebook_service.rb):

#begin code

class FacebookService
  include ServiceHelper

  MAX_MESSAGE_SIZE = 420
  attr_reader :credentials

  def initialize(credentials)
    unless credentials['uid'].present?
      raise ArgumentError.new("Please provide a UID")
    end
    @credentials = credentials
  end

  def update(message, link='')
    api_user.set_status(format_message(message, link))
  rescue Facebooker::Session::SessionExpired
    raise ServiceBroker::CredentialError.new("Sorry, Facebook can't find your account. Use our Facebook sign in link")
  rescue => e
    Rails.logger.error("Call to Facebook service failed. #{e.message}")
    raise ServiceBroker::ServiceError.new("#{e.message}")
  end

  protected

  def api_user
    @api_user ||= begin
      api_user = Facebooker::User.new(:id => credentials['uid'])
      api_user.instance_variable_set(:@session, session)
      api_user
    end
  end

  def session
    @session ||= Facebooker::Session.create
  end
end

#end code

I'm really at a loss here. Any help would be greatly appreciated.

Thanks,

Nathan
Reply all
Reply to author
Forward
0 new messages