He was named Hull City's player of the year this season but chose to turn down the offer of an extension with the English Championship club.
McGregor, 36, was offered terms to stay at Hull City, but insists he couldn't turn down the opportunity to resume his Rangers career, having left for Besiktas in 2012.
Gerrard said of McGregor: 'He is a vastly experienced goalkeeper who we feel can add to the options available to us now.
He has a spell on loan at Cardiff City past year and has 35 caps at global level with Scotland to his name. He has won lots of silverware for this club, and has shone at the highest level in Europe. He played for Dunfermline and St Johnstone on loan during his time at in Scotland but he then went on to play in over 200 Rangers games during his time at the club.
"I can't keep the smile off my face", McGregor told Rangers TV.
The 31-year-old is now thought to be interested in reuniting with Gerrard at Ibrox, but with Lazio reluctant to sell, it may be hard for Rangers to secure his signature this summer.
McGregor won three successive league titles with Rangers in 2009, 2010 and 2011. It does. I started training here when I was probably 12.
"You need to win games and it doesn't matter who you are playing".
"If you keep doing that, as we've seen before, that's what wins you titles".