How would I stop this object from flipping?

Hey everyone. This is the issue, with collisions:

I am using body-gyro, but I am not very experienced with it, so I would appreciate any help on how to make this stay up the right way!