Calvin Weir-Fields (Paul Dano) is a successful, young writer, suffering from Writers Block. Calvin has been dreaming about a faceless woman, that seems to be everything he wants in a girlfriend. On the advice of his Psychiatrist, Dr. Rosenthal (Elliot Gould), he begins writing about the faceless girl; who he has named Ruby Sparks, on a classic Typewriter. With the book taking shape and his writers block gone, he finds his mood changing, for the better.
He takes a break from writing, to attend a Book Signing and cocktail party. At the party, he meets Mabel (Alia Shawkat); a fan who gives him her number. Even though he has no interest in her, he takes the number. When he gets home from the party, he finds a bra and a pair of panties on the floor. He assumes his dog got out and stole them from a neighbor, so he throws them in a drawer and goes to bed. He wakes up in the morning to find Ruby (Zoe Kazan) in his living room. Believing she is a figment of his imagination, he tries to ignore her as much as possible. Ruby convincingly makes him start to believe that she is actually real.
In an attempt to convince himself that Ruby isn't real, he calls and sets up a meeting with Mabel. As Mabel is offering Calvin an afternoon of relationship-free sex, Ruby walks up to the table; introducing herself as Calvins Girlfriend. Mable apologizes to Ruby and Calvin knows that she is real. They go back to the house, where Calvin rereads what he has written about Ruby and realizes that whatever he writes about her, will happen. (If he writes "Ruby is sad", Ruby gets sad, if he writes "Ruby feels like dancing", she begins to dance). Calvin decides to see what will happen if he just goes along with everything and enjoys being in a relationship with "the perfect woman."
Calvin tells his best friend Harry (Chris Messina) about Ruby, and how she came to be. Harry doesn't believe him, so Calvin invites him over for dinner. Harry meets and reads about Ruby and not only believes Calvin but thinks Ruby could be good for Calvin. With Harry on board and willing to help him hide Ruby's secret, Calvin introduces Ruby to all of his friends and family.
Wanting Ruby to like him for who he is, he stops writing about what Ruby will do. This gives her free will and allows her to think and act for herself. When he takes Ruby to a party being thrown by his mentor, Langdon Tharp (Steve Coogan), Langdon begins talking with and hitting on Ruby, outside, by the pool. Just as Langdon has convinced Ruby to strip and join him in the pool, Calvin finds the two of them and becomes upset. He takes Ruby home and shows her that she is just a figment of his imagination.
Realizing that Ruby needs to be free, he writes the final page; freeing Ruby to leave him and move on with her life. He then puts the Typewriter away and replaces it with a new laptop. Calvin wakes up in the morning, to find her and all of her belongings gone and immediately sinks into a deep depression.
With the help of Harry, as well as time to heal, he moves on and decides to write about the relationship; but in a way that protects Rubys anonymity and is in the process, perceived as Fiction. The book "The Girlfriend", is a huge hit and puts Calvin back on top of the literary world.
Some time later, while walking his dog in the park, he runs into Ruby sitting alone, reading the book. She feels that they've met before but doesn't know why. He shows her his picture in the back of the book and asks to join her.
The movie ends with them sitting together talking and laughing; leading the audience to believe that they will get a fresh start and Calvin will get a second chance, at happiness.
Thanks Alan G!