I have Apache server with installed PHP by default. There are several applications working on PHP, and I'm going to run there applications on Rails also.
A server like Apache handles requests. If you make a request to a php program, then the php program will execute. If you make a request to a ruby program (i.e. a rails program), then the ruby program will execute. Typically, you will add a shebang line to a ruby program:
so that the server knows to use ruby to execute the program.
$ rails server starts the WEBrick server, which is a ruby server and has nothing to do with Apache.