Figured out it:

ftp.puttextfile(local_file, remotefile = File.basename(f))

should be:

ftp.puttextfile(f , remotefile = File.basename(f))

-- 
Posted via http://www.ruby-forum.com/.