読者です 読者をやめる 読者になる 読者になる

naichi's lab

3日後の自分(他人)への書き置き

MacOSXでRabbiterが動かない

環境

  • Mac OS X El Capitan 10.11(15A284)
  • ruby 2.2.2p95
  • rabbit 2.1.8
  • rabbiter 2.0.2

インストールまで

blog.naichilab.com

rabbiterが動かない

rabbiter.rb:139:in `show_uri': サポートしていない操作です (Gio::IOError::NotSupported)

$ rabbiter --filter "#twitter"
/Users/naichi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/twitter-stream-0.1.16/lib/twitter/json_stream.rb:27: warning: duplicated key at line 30 ignored: :path
1) このURLにアクセスしてください: https://api.twitter.com/oauth/authorize?oauth_token=FM6mfAAAAAAAA6OLAAABUC0AFDQ
/Users/naichi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rabbiter-2.0.2/lib/rabbiter.rb:139:in `show_uri': サポートしていない操作です (Gio::IOError::NotSupported)
    from /Users/naichi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rabbiter-2.0.2/lib/rabbiter.rb:139:in `show_uri'
    from /Users/naichi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rabbiter-2.0.2/lib/rabbiter.rb:122:in `setup_access_token'
    from /Users/naichi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rabbiter-2.0.2/lib/rabbiter.rb:52:in `setup'
    from /Users/naichi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rabbiter-2.0.2/lib/rabbiter.rb:70:in `start'
    from /Users/naichi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rabbiter-2.0.2/bin/rabbiter:103:in `main'
    from /Users/naichi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rabbiter-2.0.2/bin/rabbiter:125:in `<top (required)>'
    from /Users/naichi/.rbenv/versions/2.2.2/bin/rabbiter:23:in `load'
    from /Users/naichi/.rbenv/versions/2.2.2/bin/rabbiter:23:in `<main>'

/Users/naichi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rabbiter-2.0.2/lib/rabbiter.rb の140行目

rescue GLib::Error
↓
rescue GLib::Error

警告は出るけどPIN入力できるようになったしいいや。

$ rabbiter --filter "#twitter"
/Users/naichi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/twitter-stream-0.1.16/lib/twitter/json_stream.rb:27: warning: duplicated key at line 30 ignored: :path
1) このURLにアクセスしてください: https://api.twitter.com/oauth/authorize?oauth_token=-YqdqgAAAAAAA6OLAAABUC0Fmm0
[警告]
[twitter][show-uri] サポートしていない操作です
2) PINを入力してください: 

`initialize': wrong number of arguments (2 for 0..1)

$ rabbiter --filter "#twitter"
/Users/naichi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/twitter-stream-0.1.16/lib/twitter/json_stream.rb:27: warning: duplicated key at line 30 ignored: :path
/Users/naichi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/eventmachine-1.0.8/lib/em/buftok.rb:15:in `initialize': wrong number of arguments (2 for 0..1) (ArgumentError)
    from /Users/naichi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/twitter-stream-0.1.16/lib/twitter/json_stream.rb:206:in `new'
    from /Users/naichi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/twitter-stream-0.1.16/lib/twitter/json_stream.rb:206:in `reset_state'
    from /Users/naichi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rabbiter-2.0.2/lib/rabbiter.rb:81:in `start'
    from /Users/naichi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rabbiter-2.0.2/bin/rabbiter:103:in `main'
    from /Users/naichi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rabbiter-2.0.2/bin/rabbiter:125:in `<top (required)>'
    from /Users/naichi/.rbenv/versions/2.2.2/bin/rabbiter:23:in `load'
    from /Users/naichi/.rbenv/versions/2.2.2/bin/rabbiter:23:in `<main>'

/Users/naichi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/twitter-stream-0.1.16/lib/twitter/json_stream.rb

@buffer  = BufferedTokenizer.new("\r", MAX_LINE_LENGTH)
↓
@buffer  = BufferedTokenizer.new("\r", MAX_LINE_LENGTH)

これで動いた。