Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6956403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:51:54+00:00 2026-05-27T14:51:54+00:00

This is weird, and probably due to me being new to ruby. I have

  • 0

This is weird, and probably due to me being new to ruby. I have created a gem, it works, all the unit tests work, but when i do the following in irb it can’t find the “ingredients” method;

1.9.2-p290 :002 > require "tablecloth"
 => true 
1.9.2-p290 :003 > tc = TableCloth.new "1 cup of sugar"
 => #<TableCloth:0x864a728> 
1.9.2-p290 :004 > tc.ingredients
NoMethodError: undefined method `ingredients' for #<TableCloth:0x864a728>
from (irb):4
from /home/mikey/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'
1.9.2-p290 :005 > 

Entire gem is here;

https://github.com/mikeyhogarth/tablecloth

Obviously this is due to me being new to ruby. It’s not actually hindering the development, I just want to know why irb can’t seem to register that method in this case!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:51:55+00:00Added an answer on May 27, 2026 at 2:51 pm

    I think you are loading a different, older version of the gem in IRB than you are in your unit tests. Your unit tests probably test the gem code sitting in your development directory, but when you do require "tablecloth" in IRB it would load the gem that has been installed to your system’s gem’s directory. If you are using RVM, you can look at the $GEM_HOME environment variable to see what directory that is.

    You probably need to run a rake task like rake install or something like that to install your gem before you can use it in irb.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a weird one. Probably painfully obvious. :D I have a View (let's
This is weird and probably not possible but I'll ask anyway. I'm making this
I have this weird problem with setting up cookies with PHP. Everything worked fine
I have a kind of funny and weird requirement this time. I have my
i have a quite weird question which probably has no practical use but the
I have a weird situation (don't we all?) with datepickers and want to get
This is probably a stupid question but will ask anyway sine I have no
I have encountered something weird (probably not, it's more likely that I don't really
This is so weird. I have been working on a series of iterations of
Probably this is another user error, but I'm having a weird problem with this.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.