My code

```
IMAGE_DIR = 'D:\File_Server\Nisa_Costcutter\Master Nisa CC Logos'

require 'net/ssh'
require 'net/scp'

def scopy_file(file)
  puts "Transferring #{file.path}"
  Net::SCP.upload!('192.168.254.5', 
                   'passenger', 
                    file, 
                    '/var/www/pinpointlms.co.uk/shared/logos', 
                    :ssh => {password: '*****'})
end

puts "Starting Upload"

Dir.foreach(IMAGE_DIR) do |name|
  if name.length > 4 && name[-4..-1].upcase == '.BMP'

    filename=name.strip()
    file = File.new(File.join(IMAGE_DIR, filename))

    if (Time.now - file.mtime) > 86400
        scopy_file(file) 
    end

  end

end
puts "End of Transfer"

```

I am trying to copy some files from a windows box to an Ubuntu box using Ruby but I get the following output:

```
Starting Upload
Transferring D:\File_Server\Nisa_Costcutter\Master Nisa CC Logos/Z2579.BMP
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-scp-1.1.2/lib/net/scp.rb:359:in `block (3 levels) in start_command': SCP did not finish successfully (1) 
(Net::SCP::Error) from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:591:in `call' 
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:591:in `do_close'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:586:in `channel_close'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:221:in `preprocess'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:205:in `process'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `block in loop'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `loop'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `loop'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:118:in `close'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-scp-1.1.2/lib/net/scp.rb:205:in `ensure in start'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-scp-1.1.2/lib/net/scp.rb:205:in `start'
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-scp-1.1.2/lib/net/scp.rb:221:in `upload!'
    from C:/Users/administrator.GASKANDHAWLEY/Desktop/copy_images2.rb:8:in `scopy_file'
    from C:/Users/administrator.GASKANDHAWLEY/Desktop/copy_images2.rb:24:in`block in <main>'
    from C:/Users/administrator.GASKANDHAWLEY/Desktop/copy_images2.rb:17:in`foreach'
    from C:/Users/administrator.GASKANDHAWLEY/Desktop/copy_images2.rb:17:in

```

`'

I am a ruby beginner so any help you can give me on how to debug this code further will be much appreciated.

Thanks