我想用Rails 3和里面我试图通过一个初始化建立一个宝石:
Credentials.configure do |config|
file = File.read("#{Rails.root}/config/twitter.yaml")
file_config = YAML.load(file)
config.consumer_key = file_config[Rails.env][:consumer_key]
config.consumer_secret = file_config[Rails.env][:consumer_secret]
config.callback_url = URI.escape(file_config[Rails.env][:callback_url])
config.time_stamp = Time.now.to_i
end
然后我试图这样称呼它:
Credentials.time_stamp
但我得到这个错误:
uninitialized constant Twitter::Credentials
问题是什么?
谢谢