我有一個應用程序有一個任務,颳了一個網站,然後發佈一些視頻信息到youtube抓取。youtube_it在更新到Ruby 2之後拋出ArgumentError - 如何解決?
更新到紅寶石2應用程序後,在YouTube上傳停止工作,並開始呈現出以下內容:
(ArgumentError) "wrong number of arguments (2 for 0..1)"
/home/deployer/apps/project/shared/bundle/ruby/2.0.0/gems/youtube_it 2.1.13/lib/youtube_it/chain_io.rb:66:in `read'
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http/generic_request.rb:202:in `copy_stream'
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http/generic_request.rb:202:in `send_request_with_body_stream'
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http/generic_request.rb:132:in `exec'
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:1403:in `block in transport_request'
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:1402:in `catch'
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:1402:in `transport_request'
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:1375:in `request'
/home/deployer/apps/project/shared/bundle/ruby/2.0.0/gems/rest-client-1.6.7/lib/restclient/net_http_ext.rb:51:in `request'
/home/deployer/apps/project/shared/bundle/ruby/2.0.0/gems/newrelic_rpm-3.6.0.83/lib/new_relic/agent/instrumentation/net.rb:25:in `block in request_with_newrelic_trace'
/home/deployer/apps/project/shared/bundle/ruby/2.0.0/gems/newrelic_rpm-3.6.0.83/lib/new_relic/agent/cross_app_tracing.rb:39:in `trace_http_request'
/home/deployer/apps/project/shared/bundle/ruby/2.0.0/gems/newrelic_rpm-3.6.0.83/lib/new_relic/agent/instrumentation/net.rb:24:in `request_with_newrelic_trace'
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:1368:in `block in request'
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:851:in `start'
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:1366:in `request'
/home/deployer/apps/project/shared/bundle/ruby/2.0.0/gems/rest-client-1.6.7/lib/restclient/net_http_ext.rb:51:in `request'
/home/deployer/apps/project/shared/bundle/ruby/2.0.0/gems/newrelic_rpm-3.6.0.83/lib/new_relic/agent/instrumentation/net.rb:25:in `block in request_with_newrelic_trace'
/home/deployer/apps/project/shared/bundle/ruby/2.0.0/gems/newrelic_rpm-3.6.0.83/lib/new_relic/agent/cross_app_tracing.rb:39:in `trace_http_request'
/home/deployer/apps/project/shared/bundle/ruby/2.0.0/gems/newrelic_rpm-3.6.0.83/lib/new_relic/agent/instrumentation/net.rb:24:in `request_with_newrelic_trace'
/home/deployer/apps/project/shared/bundle/ruby/2.0.0/gems/faraday-0.8.7/lib/faraday/adapter/net_http.rb:75:in `perform_request'
/home/deployer/apps/project/shared/bundle/ruby/2.0.0/gems/faraday-0.8.7/lib/faraday/adapter/net_http.rb:38:in `call'
/home/deployer/apps/project/shared/bundle/ruby/2.0.0/gems/faraday-0.8.7/lib/faraday/response.rb:8:in `call'
/home/deployer/apps/project/shared/bundle/ruby/2.0.0/gems/youtube_it-2.1.13/lib/youtube_it/middleware/faraday_authheader.rb:17:in `call'
/home/deployer/apps/project/shared/bundle/ruby/2.0.0/gems/faraday-0.8.7/lib/faraday/connection.rb:247:in `run_request'
/home/deployer/apps/project/shared/bundle/ruby/2.0.0/gems/faraday-0.8.7/lib/faraday/connection.rb:112:in `post'
/home/deployer/apps/project/shared/bundle/ruby/2.0.0/gems/youtube_it-2.1.13/lib/youtube_it/request/video_upload.rb:92:in `upload'
/home/deployer/apps/project/shared/bundle/ruby/2.0.0/gems/youtube_it-2.1.13/lib/youtube_it/client.rb:106:in `video_upload'
/home/deployer/apps/project/current/app/models/cme_event.rb:169:in `upload_on_youtube'
這是關於數量的參數的簡單愚蠢的錯誤,這似乎是網/ HTTP傳遞兩個該函數的參數而不是前一個。我試圖通過添加額外的可選參數來更改youtube_it gem上的代碼,但仍然沒有運氣。
所以,任何人都知道什麼可能會改變與淨/ HTTP紅寶石2打破了這一點?
你有沒有發現任何變通針對此問題? – scaryguy