Ruby is a dynamic, object-oriented language with advanced features such as yield operator and dynamic class manipulation. They make Ruby a popular, highly productive scripting language, but they also make the semantics of Ruby complicated and difficult to understand. Even the JIS/ISO standard of Ruby seems to contain some ambiguities. For Ruby to be established as a reliable scripting language, it should have a rigorous semantics. To meet this challenge, we present a formal operational semantics that can serve as a high-level specification for both the users and implementers. The key insight underlying the semantics is that various elaborate features of Ruby can be cleanly represented as a composition of two orthogonal calculi: one for objects and classes and the other for representing control. The presented semantics leads straightforwardly to a reference implementation. Initial evaluation of our implementation confirms that the presented semantics conforms to commonly accepted Ruby behavior.