If You Have Problems Making Examples Work
When you’re starting to use a new framework, error messages can be hard, even impossible, to decipher. We’ve included occasional notes in the book about particular errors you might see, but it seems very normal for different people to encounter different errors as they work through examples. Sometimes it’s the result of skipping a step or entering code just a little differently than it was in the book. It’s probably not the result of a problem in Rails itself, even if the error message seems to come from deep in the framework. That isn’t likely an error in the framework, but much more likely a problem the framework is having in figuring out how to deal with the unexpected code it just encountered.
If you find yourself stuck, here are a few things you should check:
- What version of Ruby are you running?
You can check by entering
ruby -v. All of the examples in this book were written with Ruby 1.8.6. Older versions of Ruby may cause problems for Rails, and the 1.9 versions add features, but may create new issues as well. Chapter 1 explores how to install Ruby, but you may need to find documentation specific to your specific operating system and environment.- What version of Rails are you running?
You can check by running
rails -v. While you should be able to use the examples here with any version of Rails 2.x, the examples, including the ones you can download from the book’s site, were built on Rails 2.1.0. If you’re running a different version, ...