Dir['/path/*'].select { |f| File.directory? f }.each do |directory|
  # do your thing
end

Read more at http://www.rubycentral.com/book/ref_c_dir.html