Does the spell Rope Trick fail if the rope is longer than the height of the room?

The spell description for rope trick (PHB, pg. 272) states:

You touch a length of rope that is up to 60 feet long. One end of the rope then rises into the air until the whole rope hangs perpendicular to the ground.

What happens if I cast rope trick on a 60 foot rope in a 12 foot high room? The ceiling is not high enough for the whole rope to hang perpendicular to the ground; conceivably, it either stops rising when it hits the ceiling or it begins to pile up on the ceiling until 12 feet of it dangle to the floor. Either way, the rope does not satisfy the bolded condition in the spell description.

Does the spell fail? Do I need to cut down my rope to be less than the height of the room before casting the spell?