未初始化的常数RoR

时间:2016-06-05 21:58:03

标签: ruby-on-rails ruby

我使用自己的宝石

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

1 个答案:

答案 0 :(得分:1)

periscope = ::Periscoper::Client.new(twitter.token, twitter.secret)

很可能会解决问题。