1. Home
  2. Computing & Technology
  3. Ruby
Amanda & Michael Morin
Amanda and Michael's Ruby Blog

By Amanda & Michael Morin, About.com Guides to Ruby

What String Do I Use With 'require'?

Friday December 18, 2009

Here's a common scenario.  You've installed a gem and already know basically how to use it.  But there's a problem.  When you try to require the gem Ruby can't find it.  It seems at first that Rubygems has some kind of standardized way of requiring gems.  For example, if I install the bluecloth gem, I should just need to do a require 'bluecloth', right?  After all, bluecloth is the gem name, it should work, right?

The reality is, there is no such system.  That's only a convention.  Some gems may need to be required in a completely different manner.  Some may have multiple files to require for different feature sets.  The only real way is to read the documentation.  Or if that's not a possibility, go to your gems directory, find the directory for the gem and look in the lib and examples directories for clues.  Not all gems follow the convention, and some don't come with documentation.  The code might be perfectly good and usable, you just have to know how to get to it.

Working With Directories - The Basics

Wednesday December 16, 2009

Learning how to work with files is one of the first things new Ruby programmers learn. However, how to work with directories of files is something that's often skipped or only lightly touched upon. Though Ruby does have some powerful mechanisms for working with directories.

Read the complete article

Works in Progress: The Ruby on Rails Tutorial Book

Monday December 14, 2009

Michael Hartl, co-author of the book RailsSpace:Building a Social Networking Website with Ruby on Rails, is working on a new project on which he's looking for some feedback. He's made the first four chapters of his newest book-in-progress, The Ruby on Rails Tutorial Book, available on the Web, for your viewing and perusal.

The book sets out to provide you with answers (in tutorial and, eventually, screencast form) to the question: "If I want to learn web development with Ruby on Rails, where should I start?" And, if the first four chapters are any indication, you'll most certainly get some specific ideas of how to begin.

The draft is very user-friendly.It's easy to read, easy to follow and has some great graphical examples provided. But that's just our opinion. Hartl would welcome yours as well. So why don't you check out the book and see what you think?

Refactoring in Ruby

Tuesday December 8, 2009

Refactoring in Ruby by William C. Wake and Kevin Rutherford is a hands on workbook that teaches refactoring in Ruby. It is an update of an earlier work from William C. Wake, which taught the same subject in Java. It's a solid work on refactoring and an excellent hands on introduction.

Read the complete review.

It's a Very Ruby Holiday

Monday December 7, 2009

In the true spirit of the holidays, Satish Talim of RubyLearning.org has put together a really nice blog post listing the Rubyists and companies he's thankful for. It's a very comprehensive list, including everyone from the Ruby community itself to the public relations personnel who provide him with books about Ruby to many of the individual people and companies who contribute to the ever-growing Ruby community.

Personally, I think it's good to take a step back and acknowledge that it takes many of us to keep such a good thing going. Who are you thankful for this year?

Time to Upgrade to Ruby on Rails 2.3.5

Wednesday December 2, 2009

Rails 2.3.5 was released this weekend and, if you're still running an earlier version of 2.3, it's time to upgrade. The new version is not only compatible with previous versions, it's also designed to be more compatible with Ruby 1.9. That's because 2.3.5 includes some minor bug fixes as well as a security fix addressing the recently-announced XSS (Cross-Site Scripting) weakness in strip_tags.

For more information on the release of Rails 2.3.5, check Gregg Pollack's official release announcement post on the Riding Rails blog and, for another perspective, Mike Gunderloy's take on the release at his blog, A Fresh Cup.

If you have more questions or would like to learn more about XSS vulnerabilities and concerns, don't forget to read our series on the subject, Understanding Cross-Site Request Forgery.

Using Struct and OpenStruct

Sunday November 29, 2009

If you're looking for an alternative to hashes for storing key/value pairs, the best option is to use the Struct class. The Struct class is like a struct in C or C++. It has a set of variables you can assign to, and nothing else. In Ruby, it's just a shortcut to creating an empty class and adding some attr_accessor statements and a constructor to assign to the attributes.

Review: Refactoring: Ruby Edition

Tuesday November 24, 2009

Refactoring: Ruby Edition by Jay Fields, Shane Harvie and Martin Fowler with Kent Beck is a reworking (or refactoring, if you will) of the book Refactoring: Improving the Design of Existing Code. Refactoring is considered the best (and first) work on the subject and is akin to a refactoring version the Gang of Four book on design patterns. More than just the same book with Java examples replaced with Ruby examples, Refactoring: Ruby Edition covers many Ruby-specific problems you may face with refactoring and is every bit as important as the original Refactoring title.

Read the complete review

About.com is Looking for Freelance Writers!

Monday November 23, 2009

The About.com Contributing Writers program was created to help us cover topics that may not be broad enough for a full GuideSite. Contributing Writers work alongside our Guides, covering specific subtopics that fall within the larger topic areas of our GuideSites. They are responsible for producing a certain amount of content (articles or blog posts) per month on that subtopic. They are not responsible for managing or maintaining a full GuideSite.

We are currently evaluating candidates to write on the following topics:

  • Playing and Coaching (About Football http://football.about.com)
  • Antique Furniture (About Antiques http://antiques.about.com)
  • Legal Issues (About Single Parents http://singleparents.about.com/)
  • Gay, Lesbian, Bisexual, Transgender Scene (About Manhattan http://manhattan.about.com)
  • At-Risk Teens (About Teens http://parentingteens.about.com/)
  • XML (About HTML / Web Design http://webdesign.about.com/)
  • South Africa Travel (About Africa Travel http://goafrica.about.com)
  • Feminism in the 1960s and 1970s (About Women's History http://womenshistory.about.com/)
  • Algebra (About Math http://math.about.com)
  • Medical/Surgical Information for Patients (About Back and Neck Pain http://backandneck.about.com)
  • \

If you are interested in applying for one of these positions or learning more, please email your RESUME and a WRITING SAMPLE -- both IN THE BODY OF AN EMAIL -- to contributingwriters@about.com. Please put the topic you're applying for in the subject line. Keep introductions concise.

The Meaning of Life is 43?

Friday November 20, 2009

Douglas Adams may have decided the meaning of life is 42, but in my quest to find interesting sites built with Ruby on Rails, I've discovered that it's more likely that some people are living their lives in increments of 43. That's because two of the more unusual sites I've found are 43 People and 43 Things.

The premise of both sites is simple. They are based on the notion that everybody has 43 things they would like to get accomplished or 43 people they would like to meet. After setting up an account you can create a list of the people you'd like to meet and/or the things you'd like to do and find like-minded individuals who can help you accomplish these goals or provide information about your 43 people. It's an odd, but captivating concept. You can further the experience by posting questions about the people you'd like to meet or letting others know if you've met anybody on their list.

While 43 Things and 43 People may not yet have the wild popularity of other sites built on RoR (think YellowPages.com and Twitter), they certainly have a niche following. I, for one, am not sure if I could compose a list of 43 people I'm dying to meet, but I'm definitely going to try.

Read Archives
Explore Ruby
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Ruby

©2009 About.com, a part of The New York Times Company.

All rights reserved.