The answer depends on your station in life.
Let us see the positives and negatives of both languages:
- Ruby on rails has unit testing
- Ruby has its own OOP whereas PHP OOP is clunky.
- Ruby is better and faster for a database driver site to get online.
- Can’t write application server for PHP like Java
- PHP is a cobbled up language
- PHP is used by many although there are many forums for Ruby
- PHP Leaks too much, reloading necessary
- PHP takes less lines to code, but more time to execute
Now these are where there are marked differences, and this says that learning Ruby on Rails would be better. But there are a few clear advantages that PHP has.
- PHP is easier to learn
- PHP is stable
- There is a lot of demand for PHP
- All the CMSs like WordPress, Joomla are written in PHP
- PHP is easier to learn, you can always learn a new language later
- You have to learn the whole LAMP architecture for Ruby.
- You have to know real OOP to code in Ruby
Looking at this, it seems that there are advantages to PHP if you’re a beginner.
So our verdict would be,
If you are looking for job NOW! then go for PHP. Jobs are galore and there is a shortage of PHP programmers in the Pune Market.
But if you have time – like say you’re a (PHP) professional or a student, then go for Ruby on Rails. That’s because you want to progress with the web, then go with Rails as it’s the next generation of web framework.
PS: Many people may think that there is a dearth of jobs for ROR, but that is not so. There are enough jobs for anybody who has trained for Ruby on Rails, just that there are more jobs for PHP developers.
For a diagrammatic look, you can see this web graphic from Udemy.