我使用自己的宝石
class Periscoper
class Client
include HTTParty
attr_reader :secret, :key, :id, :username, :display_name, :cookie
base_uri 'https://api.periscope.tv/api/v2'
format :json
def initialize (key = nil, secret = nil)
p login(key, secret) if (secret && key)
end
....
end
end
当我在控制器中时,我会遵循:
periscope = Periscoper::Client.new(twitter.token, twitter.secret)
我明白了:
未初始化的常量SessionsController :: Periscoper
答案 0 :(得分:1)
periscope = ::Periscoper::Client.new(twitter.token, twitter.secret)
很可能会解决问题。