(未定义的局部变量或方法`byebug' [英] (undefined local variable or method `byebug'

查看:60
本文介绍了(未定义的局部变量或方法`byebug'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下错误:

NameError(未定义的局部变量或方法`byebug'

NameError (undefined local variable or method `byebug'

代码是

def  test
  t = ""
  byebug
end

--

RAILS_ENV=开发宝石列表 |再见

RAILS_ENV=development gem list | grep bye

再见(3.5.1)

然后我运行:

RAILS_ENV=开发导轨 s

RAILS_ENV=development rails s

但它显示:

NameError(未定义的局部变量或方法`byebug'

NameError (undefined local variable or method `byebug'

你知道为什么吗?

谢谢!

推荐答案

看来你需要

需要'byebug'

我遇到了同样的情况并且 require 失败并出现无法加载此类文件"错误,但添加到 Gemfile 中有效.

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

这篇关于(未定义的局部变量或方法`byebug'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆