github地址
https://github.com/rest-client/rest-client

gemfile里添加

gem 'rest-client', '~> 2.0'

执行
bundle install

代码里

# 要请求接口地址
# 上传文件的key名字
# file 文件的绝对路径
 resp = RestClient.post url, :file => File.new(file, 'rb')
 json = JSON.parse(resp)