karlentwistle / ruby_home

Ruby HAP Server - HomeKit support for the Rubyist

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTTP Response error on versions 0.1.16 and 0.1.15

vickash opened this issue · comments

When trying to run the fan example, I get the following error on 0.1.16 and 0.1.15:

ruby/gems/2.5.0/gems/ruby_home-0.1.16/lib/ruby_home.rb:32:in `block in start'
ruby/gems/2.5.0/gems/ruby_home-0.1.16/lib/ruby_home/hap/server.rb:19:in `run'
ruby/gems/2.5.0/gems/ruby_home-0.1.16/lib/ruby_home/hap/server.rb:19:in `loop'
ruby/gems/2.5.0/gems/ruby_home-0.1.16/lib/ruby_home/hap/server.rb:20:in `block in run'
ruby/gems/2.5.0/gems/ruby_home-0.1.16/lib/ruby_home/hap/server.rb:20:in `select'
ruby/gems/2.5.0/gems/ruby_home-0.1.16/lib/ruby_home/hap/server.rb:20:in `block (2 levels) in run'
ruby/gems/2.5.0/gems/ruby_home-0.1.16/lib/ruby_home/hap/server.rb:31:in `block in accept'
ruby/gems/2.5.0/gems/ruby_home-0.1.16/lib/ruby_home/hap/server.rb:63:in `read'
ruby/2.5.0/webrick/httpresponse.rb:205:in `send_response'
ruby/2.5.0/webrick/httpresponse.rb:214:in `rescue in send_response': undefined method `error' for nil:NilClass (NoMethodError)

This error message appears immediately when I tap "Add Anyway" (or something similar) on my phone after selecting the RubyHome bridge, before I can enter the code. If I revert to 0.1.14, the fan example works, as well as my custom scripts.

I'm on:
mac OS 10.13.6
ruby 2.5.0p0
libsodium 1.0.16

When going from 0.1.16 -> 0.1.14, I noticed the following bundler output:
Using oj 3.7.1 (was 3.7.4)
Using ruby_home 0.1.14 (was 0.1.16)

If, after adding a device on my phone, I upgrade to 0.1.16, I get the same error, this time immediately upon running the script. Back down to 0.1.14 and it works again. If there's anything further I can do to help diagnose, let me know.

Thanks very much for bringing this to my attention @vickash and for the very detailed issue. It made it easy to reproduce and fix your issue on my setup.

I have released version 0.1.17 which should fix the problem for you.

Thanks! Works fine now.