https://github.com/pry/pry
以前一直使用ruby-debug,现在有了pry更为方便了。
help
cd Article
cd first
cd name
nesting
exit
ls
ls -h
ls -m
ls -M
ls Array -M
show-doc Article#in_groups_of
show-doc all
show-doc all.in_groups_of
show-method all.in_groups_of
edit-method all.in_groups_of
.ls
.cat Gemfile
debug点使用代码是
binding.pry
安装
gem install pry pry-doc
与Rails结合
#Gemfile
gem 'pry-rails'
如何使用pry 调试 Rails
1, 安装如下几个Gem
gem 'pry-remote'
gem 'pry-nav'
2, 在项目目录下,新建.pryrc文件
Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 's', 'step'
Pry.commands.alias_command 'n', 'next'
就可以使用 n s n运行命令了