6

Getting an issue when running simple tasks in the ruby console. If I run

user = User.find(10)
User Load (0.6ms)  SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", "10"], ["LIMIT", 1]]
(Object doesn't support #inspect)

I get an 'Object doesn't support #inspect' error. My colleague has the exact same branch and has no issue. On other branches I don't have this issue either. There is definitely a result as running things like this are fine.

user.first_name
=> "Tom"

I have even deleted the branch, re-downloaded but still getting the same issue. Have removed the gemfile, bundled... tried everything I know. I even turned my laptop on and off.

bubbaspaarx
  • 616
  • 4
  • 15

1 Answers1

6

Not necessarily a full answer to this question but we tried using the pry gem instead of IRB.

gem 'pry-rails'

Added this to our development group and now uses pry instead of irb. No issues.

Must be some sort of corruption on IRB. The version we were using was 1.3.5

bubbaspaarx
  • 616
  • 4
  • 15
  • 2
    I can confirm I am getting the same behaviour with the new default ruby debug gem in a Rails environment. pry-rails works fine. – Kaka Ruto Apr 14 '22 at 19:11
  • Adding pry-rails fixed for me too. Must be a bug somewhere. – stevec Apr 28 '22 at 11:49
  • thanks! any idea why this happens in irb or how to fix it? because it looks like pry-rails is not being maintained anymore – Mi Ro Jun 20 '22 at 12:37