Ruby hipchat gem发送文件无效

Ruby hipchat gem发送文件无效,ruby,rubygems,hipchat,Ruby,Rubygems,Hipchat,这与我之前发表的一篇文章有关。这就是我通过hipchat发送文件的基本方法: #!/usr/bin/env ruby require 'hipchat' client = HipChat::Client.new('HIPCHAT_TOKEN', :api_version => 'v2', :server_url => 'HIPCHAT_URL') client.user('some_username').send_file('message', File.open('./outpu

这与我之前发表的一篇文章有关。这就是我通过hipchat发送文件的基本方法:

#!/usr/bin/env ruby
require 'hipchat'

client = HipChat::Client.new('HIPCHAT_TOKEN', :api_version => 'v2', :server_url => 'HIPCHAT_URL')
client.user('some_username').send_file('message', File.open('./output/some-file.csv') )
client['some_hipchat_room'].send_file('some_user', 'message', File.open('./output/some-file.csv') ) 
现在由于某种原因,send_file方法无效:

/path/to/gems/hipchat-1.5.4/lib/hipchat/errors.rb:40:in `response_code_to_exception_for': You requested an invalid method. path:https://hipchat.illum.io/v2/user/myuser@myemail/share/file?auth_token=asdfgibberishasdf method:Net::HTTP::Get (HipChat::MethodNotAllowed)
    from /path/to/gems/gems/hipchat-1.5.4/lib/hipchat/user.rb:50:in `send_file'

我认为这表明您应该使用POST而不是GET,但我不确定,因为我没有使用此库或Hipchat

查看,他们使用
self.class.post
发送请求,调试输出显示
Net::HTTP::Get

要调试,请尝试

file = Tempfile.new('foo').tap do |f|
  f.write("the content")
  f.rewind
end

user = client.user(some_username)
user.send_file('some bytes', file)

问题是我试图通过
http
而不是
https
连接到服务器。如果以下客户端导致问题:

client = HipChat::Client.new('HIPCHAT_TOKEN', :api_version => 'v2', :server_url => 'my.company.com')
然后尝试在公司名称的开头添加
https://

client = HipChat::Client.new('HIPCHAT_TOKEN', :api_version => 'v2', :server_url => 'https://my.company.com')

我认为这表明你应该使用POST而不是GET,但我不确定,因为我没有使用这个库或Hipchat。你使用的是什么版本的gem
cat Gemfile.lock | grep hipchat
hipchat(1.5.4)
我编辑了我的帖子以帮助调试。