yes, use rails - the following books will help you:
1 - RailsSpace by Michael Hartl and Aurelius Prochazka - the first Rails book I ever read, and it's a beauty. It takes you through the process of creating your own social network site. Nuff said... http://www.amazon.co.uk/Railsspace-Building-Networking-Addison-Wesley-Professional/dp/0321480791?ie=UTF8&s=books&qid=1209116263&sr=8-1
For more info, go to the website: http://railsspace.com/ - one thing to be aware of though is that the book was written when rails was at version 1.x so it's really geared towards users of that version BUT there is a zip file of the code for Rails 2.x users and I can assure you that it works just fine. if you do buy this book, it might be worth just following along doing everything by the book (i.e. using rails 1.x)
2 - Practical Rails Social Networking Sites - I bought this one too, and it's also very helpful http://www.amazon.co.uk/Practical-Rails-Social-Networking-Experts/dp/1590598415
Jim Neath wrote a nice article about Social Networking sites and gives some valuable advie on how to do it - http://jimneath.org/2008/04/25/building-a-social-network-site-in-rails/
- a word of warning though, some of the plugins/gems that he recommends are no longer advised (like restful_authentication) so just double google around before you use anything
With Rails, there are many many social networking plugins/template apps that you can download, modify and use - look at Insoshi http://github.com/insoshi/insoshi (created by the Michale hartl who wrote the first book that I linked to up top) - here's the projects homepage - http://dogfood.insoshi.com/
Also, i think this one looks REALLY impressive - it's called community engine - http://communityengine.org/
Good luck