From: Power One Date: 2009-03-09T18:43:27+09:00 Subject: Re: I code my first ruby script, and it got problem! Heesob Park wrote: > 2009/3/9 Power One : >> Updated script is at http://pastie.org/411503. >> `del_dir' >>        from /home/geek/My_Ruby_01/TestTheRuby/test/Test_Dir.rb:141 >> >> Anyone dare to give me any advice further? LOL... >> > > def list_file(file) > @filex == file > while @filex.to_s =~ "ls files" > Dir.entries(".").join(' ') > end > end > > should be > > def list_file(file) > @filex = file > if @filex == "ls files" > puts Dir.entries(".").join(' ') > end > end > > > Regards, > > Park Heesob Thanks Park for catching that. After that fix, I still have the same error as such: home/geek/My_Ruby_01/TestTheRuby/test/Test_Dir.rb:103:in `list_file': type mismatch: String given (TypeError) from /home/geek/My_Ruby_01/TestTheRuby/test/Test_Dir.rb:103:in `file_remove' from /home/geek/My_Ruby_01/TestTheRuby/test/Test_Dir.rb:81:in `del_dir' from /home/geek/My_Ruby_01/TestTheRuby/test/Test_Dir.rb:141 -- Posted via http://www.ruby-forum.com/.