Fixing the Poignant Guide

There’s a problem here in the Poignant Guide to Ruby, where a variable appears to go missing when loaded in a separate code file (using the ‘require’ command). In short, it’s because local variables always go out of scope when a file is loaded or required, and the best solution I can see is to Capitalize the variable, making it a constant, as suggested here. Note also that the author’s suggestion that the Poignant Guide has been corrected in the ‘final’ version does not seem to be true, since the version he points to still has the same error.

Leave a comment