(undefined local variable or method `byebug'

TGI picture TGI · Oct 15, 2014 · Viewed 8.1k times · Source

I have the follwing error:

NameError (undefined local variable or method `byebug'

Code is

def  test
  t = ""
  byebug
end

--

RAILS_ENV=development gem list | grep bye

byebug (3.5.1)

then I run :

RAILS_ENV=development rails s

but it shows:

NameError (undefined local variable or method `byebug'

Do you have any idea why?

Thanks!

Answer

tuxayo picture tuxayo · Jun 29, 2015

It seems you need to

require 'byebug'

I was in the same situation and require failed with 'cannot load such file' error but adding to the Gemfile worked.