transmission-client icon indicating copy to clipboard operation
transmission-client copied to clipboard

Can't get v0.1.0 to work

Open dignoe opened this issue 9 years ago • 1 comments

The version of this gem on rubygems is v0.1.0, but this repository has version v0.0.9. Could you please push your local changes to the repo so that we can easily see what code we are running? Looking at the gem on my local machine, there have definitely been some changes.

I'm trying to use this gem with the examples given, but none of them seem to work. With the following code, I get the error below:

#!/usr/bin/env ruby

gem 'transmission-client'

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'transmission-client'

EventMachine.run do
  t = Transmission::Client.new('localhost', 9091, 'admin', 'password')
  t.torrents do |torrents|
    torrents.each do |tor|
      puts "#{tor.name} (status: #{tor.status_name}, down: #{tor.rate_download}, up: #{tor.rate_upload}, progress: #{tor.percent_done}%, eta: #{tor.eta_text})"
    end
    EventMachine.stop
  end
end
/Users/Chad/.rvm/gems/ruby-1.9.3-p448/gems/transmission-client-0.1.0/lib/transmission-client/em-connection.rb:33:in `block in request': Unknown response. (RuntimeError)
    from /Users/Chad/.rvm/gems/ruby-1.9.3-p448/gems/eventmachine-1.0.3/lib/em/deferrable.rb:158:in `call'
    from /Users/Chad/.rvm/gems/ruby-1.9.3-p448/gems/eventmachine-1.0.3/lib/em/deferrable.rb:158:in `set_deferred_status'
    from /Users/Chad/.rvm/gems/ruby-1.9.3-p448/gems/eventmachine-1.0.3/lib/em/deferrable.rb:198:in `fail'
    from /Users/Chad/.rvm/gems/ruby-1.9.3-p448/gems/em-http-request-1.1.2/lib/em-http/client.rb:124:in `on_error'
    from /Users/Chad/.rvm/gems/ruby-1.9.3-p448/gems/em-http-request-1.1.2/lib/em-http/client.rb:118:in `unbind'
    from /Users/Chad/.rvm/gems/ruby-1.9.3-p448/gems/em-http-request-1.1.2/lib/em-http/http_connection.rb:173:in `block in unbind'
    from /Users/Chad/.rvm/gems/ruby-1.9.3-p448/gems/em-http-request-1.1.2/lib/em-http/http_connection.rb:173:in `map'
    from /Users/Chad/.rvm/gems/ruby-1.9.3-p448/gems/em-http-request-1.1.2/lib/em-http/http_connection.rb:173:in `unbind'
    from /Users/Chad/.rvm/gems/ruby-1.9.3-p448/gems/em-http-request-1.1.2/lib/em-http/http_connection.rb:31:in `unbind'
    from /Users/Chad/.rvm/gems/ruby-1.9.3-p448/gems/eventmachine-1.0.3/lib/eventmachine.rb:1438:in `event_callback'
    from /Users/Chad/.rvm/gems/ruby-1.9.3-p448/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
    from /Users/Chad/.rvm/gems/ruby-1.9.3-p448/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
    from ./transmission:8:in `<main>'

dignoe avatar Jul 19 '14 20:07 dignoe