Programming Books C Java PHP Python Learn more Browse Programming Books

Sorry, this item is not available in
Image not available for
Image not available

To view this video download Flash Player


Sign in to turn on 1-Click ordering
More Buying Choices
Have one to sell? Sell yours here
Start reading Ruby Cookbook (Cookbooks (O'Reilly)) on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Ruby Cookbook (Cookbooks (O'Reilly)) [Paperback]

Lucas Carlson , Leonard Richardson
4.7 out of 5 stars  See all reviews (32 customer reviews)

List Price: $49.99
Price: $35.13 & FREE Shipping. Details
You Save: $14.86 (30%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
Only 10 left in stock (more on the way).
Ships from and sold by Gift-wrap available.
Want it Tuesday, Feb. 18? Choose One-Day Shipping at checkout. Details
42 new from $11.57 50 used from $3.99 2 collectible from $12.00
Free Two-Day Shipping for College Students with Amazon Student


Amazon Price New from Used from
Kindle Edition $22.99  
Paperback $35.13  
Sell Your Books
Get up to 75% back when you sell your books on Amazon. Ship your books for free and get Gift Cards. Learn more.

Book Description

July 26, 2006 0596523696 978-0596523695 0

Do you want to push Ruby to its limits? The Ruby Cookbook is the most comprehensive problem-solving guide to today's hottest programming language. It gives you hundreds of solutions to real-world problems, with clear explanations and thousands of lines of code you can use in your own projects.

From data structures and algorithms, to integration with cutting-edge technologies, the Ruby Cookbook has something for every programmer. Beginners and advanced Rubyists alike will learn how to program with:

  • Strings and numbers
  • Arrays and hashes
  • Classes, modules, and namespaces
  • Reflection and metaprogramming
  • XML and HTML processing
  • Ruby on Rails (including Ajax integration)
  • Databases
  • Graphics
  • Internet services like email, SSH, and BitTorrent
  • Web services
  • Multitasking
  • Graphical and terminal interfaces

If you need to write a web application, this book shows you how to get started with Rails. If you're a system administrator who needs to rename thousands of files, you'll see how to use Ruby for this and other everyday tasks. You'll learn how to read and write Excel spreadsheets, classify text with Bayesian filters, and create PDF files. We've even included a few silly tricks that were too cool to leave out, like how to blink the lights on your keyboard.

The Ruby Cookbook is the most useful book yet written about Ruby. When you need to solve a problem, don't reinvent the wheel: look it up in the Cookbook.

Frequently Bought Together

Ruby Cookbook (Cookbooks (O'Reilly)) + The Ruby Programming Language
Price for both: $63.00

Buy the selected items together
  • The Ruby Programming Language $27.87

Editorial Reviews

About the Author

Lucas Carlson is a professional Ruby programmer who specializes in Rails web development. He has authored a half dozen libraries and contributed to many others, including Rails and RedCloth. He lives in Portland, Oregon and maintains a website at

Leonard Richardson has been programming since he was eight years old. Recently, the quality of his code has improved somewhat. He is responsible for libraries in many languages, including Rubyful Soup. A California native, he now works in New York and maintains a website at

Product Details

  • Series: Cookbooks (O'Reilly)
  • Paperback: 910 pages
  • Publisher: O'Reilly Media (July 26, 2006)
  • Language: English
  • ISBN-10: 0596523696
  • ISBN-13: 978-0596523695
  • Product Dimensions: 1.6 x 6.8 x 9.2 inches
  • Shipping Weight: 2.9 pounds (View shipping rates and policies)
  • Average Customer Review: 4.7 out of 5 stars  See all reviews (32 customer reviews)
  • Amazon Best Sellers Rank: #255,263 in Books (See Top 100 in Books)

More About the Authors

Discover books, learn about writers, read author blogs, and more.

Customer Reviews

4.7 out of 5 stars
4.7 out of 5 stars
3 star
2 star
1 star
Most Helpful Customer Reviews
55 of 59 people found the following review helpful
4.0 out of 5 stars An essential cookbook August 28, 2006
I have a confession to make. Over more than twenty years as a programmer I'd never really had my head around object-oriented programming. I started out using C and then tried PHP and Perl and treated both as purely procedural languages (indeed, one Perl guru looked at my code and said "you were a C programmer weren't you"; humbling). Java, JavaScript, C++ and even Objective C had their turn at getting me to convert but none took (though I do code JavaScript under sufferance) until Ruby. A few month ago I started using Rails and became hooked on it and the underlying language. My Rails and Ruby skills have progressed in leaps and bounds. I've already had a good read of "Programming Ruby" and "Agile Web Development with Rails" and enjoyed and learnt from both.

I also have to admit to loving the O'Reilly "Cookbook" series. Several, particularly the "Perl Cookbook", have pride of place on the bookshelf closest to my computer. So the "Ruby Cookbook" by Lucas Carlson and Leonard Richardson was eagerly awaited. The "Cookbook" series are designed to provide you with a plethora of code examples to guide you in writing your own code. I'm definitely a hands-on style of learner and the Cookbook series suits my style - I can start getting my hands dirty with complex problems knowing I have help to code my way of out of the tight spots. This one covers a wide range of tasks from simple, such as walking a directory tree or manipulating text and numbers, through to more complex such as working with AJAX in Ruby on Rails. If you have't previously come across a book in this style then each chapter is broken up into a number of 'recipes' with a problem, a solution and then discussion of the solution.
Read more ›
Was this review helpful to you?
13 of 14 people found the following review helpful
5.0 out of 5 stars A definite keeper September 1, 2006
Format:Paperback|Amazon Verified Purchase
Some O'Reilly books are horrible, and some are great--this happens to be one of the better ones. It's full of concise examples of how to use Ruby's standard libraries and most popular extensions that more than make up for their frequently terrible and always unnavigable RubyDoc generated documentation. An excellent next step for those who've read through "Programming Ruby" and are wondering how to put the language's better features to good use without becoming completely dependent on any of the currently popular application frameworks I'd guess about 90% of people are learning Ruby for. It even covers RubyCocoa basics.

I have found a couple typos here and there, but mostly just misplaced spaces and omitted words; nothing dangerous so far.
Comment | 
Was this review helpful to you?
8 of 8 people found the following review helpful
4.0 out of 5 stars Useful - keep it by your side August 11, 2006
Ok. Let's pretend you're a Java programmer, and you want to know what's the story about this Ruby language you've heard so much about. Or maybe, like me, you're a Smug Smalltalk Weenie and you want to check how the young cousin from the East is doing. Either way, you got your hands on a manual or on a tutorial, and now you're reasonably sure you have a good grasp of the language. But you still have to learn the slang, and _that_ is the difficult part.

But don't worry, here comes the Ruby Cookbook to the rescue. The book is a full, 850-pages behemoth full of Ruby tips and tricks, from string manipulation to database management, from reflection to multitasking.

Presenting their tips in the usual O'Reilly cookbook format (problem/solution/discussion), the two authors cover almost all the topics of interest for both the beginner and the expert Ruby programmer.

All in all, the Ruby Cookbook is like a dictionary that you should keep by your side when you're programming in Ruby. The only small con is the high number of typos, especially in the first part: nothing which stops you from understanding what the authors are saying, but finding a typo in almost every page of a chapter gets tiresome after a while.

Anyway, you can't go wrong by buying this book.
Comment | 
Was this review helpful to you?
7 of 7 people found the following review helpful
5.0 out of 5 stars Great collection of Ruby recipes and techniques January 2, 2007
This cookbook is aimed at people who know at least a little bit of Ruby, or who know a fair amount about programming in general. This book isn't a Ruby tutorial, but if you're already familiar with a few other programming languages, you should be able to pick up Ruby by going through the first 10 chapters of this book. This book contains recipes suitable for all skill levels. It focuses mainly on generic programming techniques, but it also covers specific application frameworks such as Ruby on Rails and GUI libraries, as well as best practices such as unit testing. I discuss the book further in the context of the table of contents:

The book starts with six chapters covering Ruby's built-in data structures.

Chapter 1, Strings, contains recipes for building, processing, and manipulating strings of text. There are a few recipes specifically applicable to regular expressions (Recipes 1.17, 1.18, and 1.19).

Chapter 2, Numbers, covers the representation of different types of numbers: real numbers, complex numbers, arbitrary-precision decimals, and so on. It also includes Ruby implementations of common mathematical and statistical algorithms, and explains some Ruby quirks you'll run into if you create your own numeric types (Recipes 2.13 and 2.14).

Chapter 3, Date and Time, covers Ruby's two interfaces for dealing with time: the one based on the C time library, which may be familiar to you from other programming languages, and the one implemented in pure Ruby, which is more idiomatic.

Chapter 4, Arrays, introduces the array, Ruby's simplest compound data type.

Chapter 5, Hashes, covers the hash, Ruby's other basic compound data type.

Chapter 6, Files and Directories, covers techniques for reading, writing, and manipulating files.
Read more ›
Comment | 
Was this review helpful to you?
Most Recent Customer Reviews
5.0 out of 5 stars going on
I was realy happy for recieving this book, it is full of reciepes that you can use to improve your knowledge.
Published 7 months ago by David Acosta
5.0 out of 5 stars Ruby Cookbook
The services was excellent. The book was in better shape that I thought. The writing of the book was as good as the other cookbooks Perl.
Published 9 months ago by Nicholas Cruz
5.0 out of 5 stars A must read book for every programmer!
* Very accurate, fast & clever.
* Amazing lookup tool - sometimes finding an answer in the book is faster than google!

Just read it!
Published 11 months ago by Ishay Green
4.0 out of 5 stars Bulky but efficient
I bought this book on a shopping spree. Just needed a 3rd book to add to my shopping basket for a '3 = 2' promotion, it had good reviews so I bought it. Read more
Published on May 28, 2009 by waveninja
5.0 out of 5 stars Wonderful Cookbook
Published by acclaimed authors Lucas Carlson and Leonard Richardson, The Ruby Cookbook is an excellent learning tool and reference manual. Read more
Published on February 3, 2009 by Andrei Mouravski
5.0 out of 5 stars Good Stuff
Yes you can read online material but it's just not as good. The book really has some great content.
Published on May 27, 2008 by Fernando Barajas
4.0 out of 5 stars Why not!
Not a simple cookbook (o'reilly is cool). A lot of usefull informations and several lines about the differences with some other languages (python, java)

Is not a "must"... Read more
Published on February 6, 2008 by M. Veltri
4.0 out of 5 stars Another great Cookbook from O'Reilly
As with most O'Reilly cookbooks, Ruby Cookbook has two main avenues of exploration: the core of the language, and an introduction to some of the more important libraries, presented... Read more
Published on January 26, 2008 by Thing with a hook
4.0 out of 5 stars This One's Just Right
Great stuff. I suggest this book for a first look at Ruby over and above Programming Ruby and Agile Web Development. Read more
Published on January 19, 2008 by Scott Bellware
5.0 out of 5 stars full explanations, thorough examples, good reference
i found ruby cookbook is a good read for learning ruby, provides good thorough explanations of the topics, and gives great examples as well. Read more
Published on October 17, 2007 by bloot
Search Customer Reviews
Only search this product's reviews

What Other Items Do Customers Buy After Viewing This Item?


Topic From this Discussion
when will this book released?
I think it will be released tomorrow (July 24) to coincide with OSCON.
Jul 23, 2006 by Leonard Richardson |  See all 4 posts
Have something you'd like to share about this product?
Start a new discussion
First post:
Prompts for sign-in

Search Customer Discussions
Search all Amazon discussions

Look for Similar Items by Category

Want to discover more products? You may find many from daemon thread shopping list.


If you have a question or problem, visit our Help pages.
 Would you like to update product info or give feedback on images?
If you are a seller for this product and want to change product data, click here (you may have to sign in with your seller id).

Your Recently Viewed Items and Featured Recommendations 

After viewing product detail pages, look here to find an easy way to navigate back to pages you are interested in.