To solve this problem, we can use similar triangles. Let's call the height of the building "h". Then, we have two similar triangles: one formed by Ruby, the tree, and the top of the tree; and the other formed by Ruby, the building, and the top of the building.
We know that the height of the tree is 20 feet, and the distance from the tree to Ruby is 31 feet. We also know that the distance from Ruby to the building is 190 feet.
Using these values, we can set up a proportion:
h / (190 + 31) = 20 / 31
Simplifying the proportion, we get:
h / 221 = 20 / 31
Multiplying both sides by 221, we get:
h = (20 / 31) * 221
h ≈ 143.23
Therefore, the height of the building is approximately 143 feet. Rounded to the nearest foot, the height of the building is 143 feet.