0

When trying to use byebug for the first time with ruby 2.2.3 I get

NameError:
      undefined local variable or method `byebug'

I'm confused, here's are some diagnostics:

ruby --version
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]

cat Gemfile | grep bye
gem 'byebug'

gem list | grep bye
byebug (8.2.1, 8.2.0)

#the command I'm using to run my ruby code is
rspec *spec.rb --tag focus
#also tried prepending bundle exec
american-ninja-warrior
  • 7,397
  • 11
  • 46
  • 80

2 Answers2

0

Figure it out. I needed this line:

require 'byebug'; byebug;

in my ruby code.

american-ninja-warrior
  • 7,397
  • 11
  • 46
  • 80
0

did you run bundle install on your app (assuming this is in the context of a rails app given that you're using Gemfiles)?

Edit: you figured it out, I see :D I was going to suggest requiring the library next but I see that I didn't need to.

Alfredo Gallegos
  • 613
  • 6
  • 22