Q:

In Ruby what does array.select { |x| array.count(x) > 1 } mean in words?

What does array.count(x) mean in the following:
arr1 = [1, 1, 3, 2, 6, 7, 9 ,6, 5, 1, 8, 9, 3]

def dups (array)
  duplicates = array.select { |x| array.count(x) > 1} #the (x) 
  duplicates.uniq
end

p dups(arr1) => [1,3,6,9]

The  result is what I want, but I'm having a hard time understanding when I say what the block of code is doing. I've been playing around with the code and removing (x) to see that I then just get all the unique numbers in the array once, but I can't get through the array.count(x) > 1 part.

A:

select is a filtering method. It passes each element to the block, and the block determines whether that element should be included in the output by returning true or false.
The block in your code does so by counting how often that element occurs in the array. If it occurs more than once, the block returns true, and select includes the corresponding element in the output.
It might help to put x, x's count, and the block's return value in a table:
 x | count(x) | count(x) > 1
---+----------+-------------
 1 | 3        | true
 1 | 3        | true
 3 | 2        | true
 2 | 1        | false
 6 | 2        | true
 7 | 1        | false
 9 | 2        | true
 6 | 2        | true
 5 | 1        | false
 1 | 3        | true
 8 | 1        | false
 9 | 2        | true
 3 | 2        | true

Your select returns all elements with a count above 1: (those with  true in the last column)
array = [1, 1, 3, 2, 6, 7, 9, 6, 5, 1, 8, 9, 3]
array.select { |x| array.count(x) > 1 }
#=> [1, 1, 3, 6, 9, 6, 1, 9, 3]

uniq then gets rid of the duplicates:
array.select { |x| array.count(x) > 1 }.uniq
#=> [1, 3, 6, 9]

You might have noticed that count has to traverse array once for each element in order to count its occurrences.
It's much faster to use a hash for counting the elements:
counts = Hash.new(0)
array.each { |x| hash[x] += 1 }
counts
#=> {1=>3, 3=>2, 2=>1, 6=>2, 7=>1, 9=>2, 5=>1, 8=>1}

Counting occurrences is so common that Ruby 2.7 has a dedicated method tally:
counts = array.tally
#=> {1=>3, 3=>2, 2=>1, 6=>2, 7=>1, 9=>2, 5=>1, 8=>1}

Now we can simple select the keys with a value above 1:
counts.select { |k, v| v > 1 }
#=> {1=>3, 3=>2, 6=>2, 9=>2}

counts.select { |k, v| v > 1 }.keys
#=> [1, 3, 6, 9]

