Nothing matches PHP adoption. It started 10 years before than Ruby and Python web frameworks and its runtime model is ideal for free hosting. That gave it mindshare and market share. It's still one of the ugliest languages even if it's slowly getting a face lift.
At the time its competitors where Java and Perl. Perl could have the same runtime model and was the first language for the web thanks to CGI.pm. PHP won because its simplicity and the commands embedded in the HTML page. Java is another world and only suited to corporate developers especially because there could be hardly a free Java hosting. Any of them now, not counting the AWS Lambda free tier?
[1] http://www.payscale.com/research/UK/Job=PHP_Developer/Salary
[2] http://www.payscale.com/research/UK/Job=Ruby_Software_Develo...
Besides, PHP codebases are notorious for being incredibly messy. PHP as a language used to suck big time, so you'd be taking over lots and lots of legacy code that would make you cry. That's nowhere as big of a problem with Rails: it's newer and Ruby is a joy to work with.