Ruby 将Twitter发布功能添加到Octopress博客

Ruby 将Twitter发布功能添加到Octopress博客,ruby,twitter,twitter-oauth,octopress,Ruby,Twitter,Twitter Oauth,Octopress,我在这里关注了这篇博文:我认为一切都进行得很顺利 当我尝试写博客时,这就是我通过运行rake new\u post rake aborted! undefined method `configure' for Twitter:module /root/danijelj.com/Rakefile:31:in `<top (required)="">' /usr/local/rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in

我在这里关注了这篇博文:我认为一切都进行得很顺利

当我尝试写博客时,这就是我通过运行
rake new\u post

rake aborted!
undefined method `configure' for Twitter:module
/root/danijelj.com/Rakefile:31:in `<top (required)="">'
/usr/local/rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `<main>'

这句话直接来自上面提到的帖子。有人能帮我解释一下吗?

看来那个博客已经过时了。根据文档,他们显示此表单是为了完成博客中显示的内容

配置就像Twitter::REST::Client一样工作

client = Twitter::Streaming::Client.new do |config|
  config.consumer_key        = "YOUR_CONSUMER_KEY"
  config.consumer_secret     = "YOUR_CONSUMER_SECRET"
  config.access_token        = "YOUR_ACCESS_TOKEN"
  config.access_token_secret = "YOUR_ACCESS_SECRET"
end
以粗略的方式搜索存储库,得到以下结果:github.com/sferik/twitter/search?q=configure&ref=cmdform


似乎没有您的错误报告的配置方法

你用的是哪种宝石?Ruby 2.0.0准备好了吗?我安装了Twitter 5.0.0
gem安装Twitter
gem“Twitter”、“~>5.0.0”,并且似乎没有您的错误报告的配置方法。您是如何找到结果的?将来我会去哪里找到这样的答案?我找到了你在哪里找到的信息。我会很快测试它!我只是查看了存储库和文档,如果失败了,我会抓起gem并将其解压缩,然后使用类似
grep
awk
pry
的东西来查看代码。源代码本身通常有最好的答案。
client = Twitter::Streaming::Client.new do |config|
  config.consumer_key        = "YOUR_CONSUMER_KEY"
  config.consumer_secret     = "YOUR_CONSUMER_SECRET"
  config.access_token        = "YOUR_ACCESS_TOKEN"
  config.access_token_secret = "YOUR_ACCESS_SECRET"
end