所以这与我在此method上发表的一篇早期文章有关。这基本上是我在用通过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('./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/[email protected]/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。 –
您使用的是什么版本的宝石? '猫Gemfile.lock | grep hipchat' –
'hipchat(1.5.4)' –