【发布时间】:2016-08-09 00:31:18
【问题描述】:
我最近安装了 pry 来替换我的 irb。起初它运行良好,但现在每次我运行 pry 时它根本无法识别本地应用程序环境。我得到如下信息:
[3] pry(main)> show-models
NameError: undefined local variable or method `show' for main:Object
from (pry):2:in `__pry__'
我已尝试卸载并重新安装 pry-rails gem,并将以下代码添加到初始化程序文件中:
Rails.application.configure do
# Use Pry instead of IRB
silence_warnings do
begin
require 'pry'
IRB = Pry
rescue LoadError
end
end
end
对这可能是什么有什么想法?我似乎找不到这方面的任何信息。
我的 gem 文件如下所示:
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
gem 'pry-rails'
gem 'pry-byebug'
end
【问题讨论】:
标签: ruby-on-rails ruby pry