So when I try loading a ruby file in pry it works fine by displaying ‘true’ but then when I try to call the method by prime?(2) it shows error message saying "undefined local variable or method ‘prime?’ " and I am stuck at this point.
PS. I am using ubuntu and following exact instructions as mentioned in the debugging section of alpha course.
Which exercise set are you working on? Are you sure you’ve defined a method named
prime? and that it’s in the file you’re loading into pry?
I am having the same problem on Mac. https://www.aaonline.io/alpha-curriculum/3.0/using-the-debugger
 pry(main)> load ‘prime.rb’
NoMethodError: undefined method
prime?' for main:Object from: (pry):6:inpry’
Please share your code for best results
Here is the code I am using
(1…num).each do |idx|
if num % idx == 0
ps = 
num = 1
while ps.count < num_primes
primes << num if prime?(num)
if $PROGRAM_NAME == FILE
This is a name collision. The file and the method have the same name, so pry can’t tell the difference. Change the name of the method or the file and try again.
Thanks! Worked out for me.