Ruby 推特红宝石可以';不认证

Ruby 推特红宝石可以';不认证,ruby,twitter,Ruby,Twitter,尽管我已经仔细检查了我所有的代币,但我还是不断得到下面的错误 这是全部错误: .rvm/gems/ruby-2.0.0-p247/gems/twitter-5.1.1/lib/twitter/rest/response/raise_error.rb:22:in `on_complete': Could not authenticate you (Twitter::Error::Unauthorized) from /Users/gregg/.rvm/gems/ruby-2.0.0-p247/ge

尽管我已经仔细检查了我所有的代币,但我还是不断得到下面的错误

这是全部错误:

.rvm/gems/ruby-2.0.0-p247/gems/twitter-5.1.1/lib/twitter/rest/response/raise_error.rb:22:in `on_complete': Could not authenticate you (Twitter::Error::Unauthorized)
from /Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/faraday-0.8.8/lib/faraday/response.rb:9:in `block in call'
from /Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/faraday-0.8.8/lib/faraday/response.rb:63:in `on_complete'
from /Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/faraday-0.8.8/lib/faraday/response.rb:8:in `call'
from /Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/faraday-0.8.8/lib/faraday/request/url_encoded.rb:14:in `call'
from /Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/faraday-0.8.8/lib/faraday/request/multipart.rb:13:in `call'
from /Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/twitter-5.1.1/lib/twitter/rest/request/multipart_with_file.rb:15:in `call'
from /Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/faraday-0.8.8/lib/faraday/connection.rb:253:in `run_request'
from /Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/faraday-0.8.8/lib/faraday/connection.rb:118:in `post'
from /Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/twitter-5.1.1/lib/twitter/rest/client.rb:131:in `request'
from /Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/twitter-5.1.1/lib/twitter/rest/client.rb:103:in `post'
from /Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/twitter-5.1.1/lib/twitter/rest/api/utils.rb:123:in `object_from_response'
from /Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/twitter-5.1.1/lib/twitter/rest/api/tweets.rb:125:in `update'
from drbronnersbot.rb:20:in `<main>'
.rvm/gems/ruby-2.0.0-p247/gems/twitter-5.1.1/lib/twitter/rest/response/raise\u error.rb:22:“on\u complete”中:无法对您进行身份验证(twitter::error::Unauthorized)
from/Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/faraday-0.8.8/lib/faraday/response.rb:9:in'block in call'
from/Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/faraday-0.8.8/lib/faraday/response.rb:63:in'on_complete'
from/Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/faraday-0.8.8/lib/faraday/response.rb:8:in'call'
from/Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/faraday-0.8.8/lib/faraday/request/url_encoded.rb:14:in'call'
from/Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/faraday-0.8.8/lib/faraday/request/multipart.rb:13:in'call'
来自/Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/twitter-5.1.1/lib/twitter/rest/request/multipart_with_file.rb:15:in'call'
from/Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/faraday-0.8.8/lib/faraday/connection.rb:253:在“运行请求”中
from/Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/faraday-0.8.8/lib/faraday/connection.rb:118:in'post'
from/Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/twitter-5.1.1/lib/twitter/rest/client.rb:131:在“请求”中
from/Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/twitter-5.1.1/lib/twitter/rest/client.rb:103:in'post'
from/Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/twitter-5.1.1/lib/twitter/rest/api/utils.rb:123:in'object\u from\u response'
from/Users/gregg/.rvm/gems/ruby-2.0.0-p247/gems/twitter-5.1.1/lib/twitter/rest/api/tweets.rb:125:in'update'
来自Bronnersbot博士.rb:20:in`'
你知道我在dev.twitter.com上缺少什么设置吗?还是别的?下面是我的代码:

require 'twitter'

def pick_random_line
  chosen_line = nil
  File.foreach("label.txt").each_with_index do |line, number|
    chosen_line = line if rand < 1.0/(number+1)
  end
  return chosen_line.scan(/.{1,140}/)
end


client = Twitter::REST::Client.new do |config|
  config.consumer_key    = "my key"
  config.consumer_secret = "my secret"
  config.access_token    = "my access token"
  config.access_token_secret = "my access token secret"
end

puts pick_random_line
client.update(pick_random_line)
require'twitter'
def拾取随机线
选择线=零
File.foreach(“label.txt”)。每个带有索引do的行,编号|
选择的线=兰德<1.0/(数字+1)时的线
结束
返回所选的_行扫描(/.{1140}/)
结束
client=Twitter::REST::client.new do | config|
config.consumer\u key=“我的钥匙”
config.consumer\u secret=“我的秘密”
config.access\u token=“我的访问令牌”
config.access\u token\u secret=“我的访问令牌密钥”
结束
将“pick_”随机放置到线中
client.update(选择随机行)

也显示代码,而不仅仅是错误。事实上,更新不喜欢我直接传递,所以我做了以下操作:tweet=pick\u random\u line.join client.update(tweet)