我用 ruby 写了一些代码。当我尝试运行代码时出现此错误:
/Users/macbook/.rvm/gems/ruby-2.2.2/gems/rufus-scheduler-3.3.3/lib/rufus/scheduler/zotime.rb:41:
in `initialize':
cannot determine timezone from nil (etz:nil,tnz:"+03",tzid:nil) (ArgumentError)
编辑:
我正在使用电子书宝石。我只添加了消费者密钥和访问令牌。我的 .rb 文件是:
require 'twitter_ebooks'
class MyBot < Ebooks::Bot
def configure
self.consumer_key = 'Consumer Key'
self.consumer_secret = 'Consumer Secret'
self.blacklist = ['tnietzschequote']
self.delay_range = 1..6
end
def on_startup
scheduler.every '24h' do
end
end
def on_message(dm)
end
def on_follow(user)
end
def on_mention(tweet)
end
def on_timeline(tweet)
end
def on_favorite(user, tweet)
end
def on_retweet(tweet)
end
end
MyBot.new("twitter_id") do |bot|
bot.access_token = "Access Token" # Token connecting the app to this account
bot.access_token_secret = "Access Token Secret"
end
如果有人帮助我,我会很高兴。