<button id="mgqzr"></button>
<noscript id="mgqzr"></noscript>
<button id="mgqzr"></button>
<pre id="mgqzr"><sup id="mgqzr"><sub id="mgqzr"></sub></sup></pre>
<noscript id="mgqzr"><b id="mgqzr"></b></noscript><button id="mgqzr"></button>

<noscript id="mgqzr"></noscript><button id="mgqzr"><b id="mgqzr"><th id="mgqzr"></th></b></button>
<pre id="mgqzr"><b id="mgqzr"></b></pre><button id="mgqzr"><menuitem id="mgqzr"><table id="mgqzr"></table></menuitem></button>
<pre id="mgqzr"><input id="mgqzr"></input></pre>

Twitter :: Error :: Forbidden - 無法驗證您的憑據 [英] Twitter::Error::Forbidden - Unable to verify your credentials

查看:21240
本文介紹了Twitter :: Error :: Forbidden - 無法驗證您的憑據的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在使用devise + omniauth,我可以正確連接到twitter api。

I'm using devise + omniauth and I can connect to twitter api correctly.

但是當我嘗試使用twitter寶石時,控制臺中出現以下錯誤:

But when I try to use twitter gem, I have the following error in console :

Twitter :: Error :: Forbidden - 無法驗證您的憑據

"Twitter::Error::Forbidden - Unable to verify your credentials"

我已經安裝gem并在config / initializers / twitter.rb中創建一個初始化器

I have installed the gem and created an initializer at config/initializers/twitter.rb

Twitter.configure do |config|
    config.consumer_key = PKe41...
    config.consumer_secret = qETY.....
end

我正在嘗試一個控制器:

And I'm trying into a controller :

def twitter
    @twitter_home_timeline = Twitter.home_timeline
end


推薦答案

Ok ,我發現答案...初始化器中的鍵必須用引號設置:

Ok, I found the answer... Keys in the initializer must be set with quotation marks :

Twitter.configure do |config|
    config.consumer_key = 'PKe41...'
    config.consumer_secret = 'qETY.....'
end

這篇關于Twitter :: Error :: Forbidden - 無法驗證您的憑據的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持IT屋!

查看全文
相關文章
登錄 關閉
掃碼關注1秒登錄
發送“驗證碼”獲取 | 15天全站免登陸
亚洲AV无码国产精品
<button id="mgqzr"></button>
<noscript id="mgqzr"></noscript>
<button id="mgqzr"></button>
<pre id="mgqzr"><sup id="mgqzr"><sub id="mgqzr"></sub></sup></pre>
<noscript id="mgqzr"><b id="mgqzr"></b></noscript><button id="mgqzr"></button>

<noscript id="mgqzr"></noscript><button id="mgqzr"><b id="mgqzr"><th id="mgqzr"></th></b></button>
<pre id="mgqzr"><b id="mgqzr"></b></pre><button id="mgqzr"><menuitem id="mgqzr"><table id="mgqzr"></table></menuitem></button>
<pre id="mgqzr"><input id="mgqzr"></input></pre>