Rails gem tweetstream with Encryption not available on this event-machine error

别等时光非礼了梦想. 提交于 2020-01-24 10:49:55

问题


I'm trying to display tweets using gem tweetstream and following the guide at https://github.com/tweetstream/tweetstream

In my tweets_helper.rb

  require "twitter" require 'tweetstream'

  module TweetsHelper   
    @@client = Twitter::REST::Client.new do |config|
    config.consumer_key        = Rails.application.config.twitter_key
    config.consumer_secret     = Rails.application.config.twitter_secret
    config.access_token        = Rails.application.config.twitter_oauth_token
    config.access_token_secret = Rails.application.config.twitter_oauth_secret
   end

  def user_timeline
    @@client.user_timeline   
  end

  TweetStream.configure do |config|
    config.consumer_key        = Rails.application.config.twitter_key
    config.consumer_secret     = Rails.application.config.twitter_secret
    config.oauth_token        = Rails.application.config.twitter_oauth_token
    config.oauth_token_secret = Rails.application.config.twitter_oauth_secret
    config.auth_method= :oauth  

  end

    TweetStream::Client.new.track('Pink Floyd') do |status|
      puts "#{status.text}"     
    end 
 end

But this throws me this error in the terminal and shuts down the localserver

c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/tweetstream-2.6.1/lib/tweet stream/client.rb:400: warning: epoll is not supported on this platform c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/tweetstream-2.6.1/lib/tweet stream/client.rb:401: warning: kqueue is not supported on this platform terminate called after throwing an instance of 'std::runtime_error' what(): Encryption not available on this event-machine

This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.

However the server runs if I remove

TweetStream::Client.new.track('Pink Floyd') do |status|  
  puts "#{status.text}"
end

How do I fix this error?

UPDATE I think all signs point to installing libssl-dev https://github.com/plamoni/SiriProxy/issues/41. On Ubuntu it is aptitude install libssl-dev. How do I do it on windows 8?

来源:https://stackoverflow.com/questions/32842637/rails-gem-tweetstream-with-encryption-not-available-on-this-event-machine-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!