Problem: When working with some Ruby code in an irb session, I just got the following error message:
NameError: uninitialized constant Tempfile
Here's a snippet of my irb session where this error occurred:
>> tmp = Tempfile.new
NameError: uninitialized constant Tempfile
from (irb):1
Solution
This "NameError: uninitialized constant" looks intimidating, but it's actually not a big deal: I just forgot to require the tempfile package.