change to any directory in the remote filesystem:
require 'net/ftp' ftp = Net::FTP.new('ftp.ruby-lang.org') ftp.passive = true ftp.login(username, password) ftp.chdir('pub') ftp.chdir('/pub/ruby') ftp.list('*') { |file| puts file } ftp.close