Topic: How to tar/zip files using linux commands in rb files?

here is my code...i cant figure it out what the error is..pls help
        dir = '#{Rails.root}/extensions/ajed/linux'
    Dir.chdir dir
  [
    'tar czvf data.tar.gz pimm_data','tar czvf data123.tar.gz *',
    'tar czvf control.tar.gz pimm',
  ].each do |command|
    puts command
    system(command)
    end

    ls_results = `tar czvf data.tar.gz *`     <----- it gives all the files in the directory but didnt do the tar command