Here are the docs and here is a highly rated StackOverflow answer. (The docs are pretty long, you will probably want to search the web page for "unique" to find the relevant info.)
Bottom line: You need to create an index and make the index unique:
add_index :table_name, :column_name, :unique => true
Hope this helps. Any questions let me know.
-Phil