Problem installing cocoa pods on my MacBook Pro

When I use the command ’ sudo gem install cocoapods ’ , it asks for my password, which I know I do not have to enter, however, it takes forever to run and doesn’t show any message and when I ‘press enter’, it shows me message saying ‘Sorry, try again’. Please help me out with this. Thank you!