In this video, I create a Sinatra app that creates syntax highlight using Ultraviolet gem. It uses MongoDB to store the code pasted. You can actually use the code to create your own Pastie clone.
Show Notes:
Link to the code: https://github.com/joonyou/screencasts/tree/master/my_pastie
Sinatra: http://www.sinatrarb.com
Ultraviolet: https://github.com/grosser/ultraviolet