gem install pry pry-doc awesome_print
http://railscasts.com/episodes/280-pry-with-rails
如果出不来exit!
用pry来启动rails c
pry -r ./config/environment
调试运行中的
gem 'pry-rails', :group => :development
rails s (不能用thin等)
UAGE:
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
https://github.com/pry/pry/wiki http://vimeo.com/26391171
参考: http://cubiclemuses.com/cm/articles/2011/12/19/pry-ruby-open/ http://banisterfiend.wordpress.com/2012/02/14/the-pry-ecosystem/
pry 代替 Rails console 的 irb,不用加进 Gemfile
http://ruby-china.org/topics/2471
gem install rails-console-pry pry-doc awesome_print
$RAILS_ROOT ~
rails-console-pry
rails-console-pry production
rails-console-pry -r pry-doc -r awesome_print
alias rpry='rails-cosnole-pry -r pry-doc -r awesome_print'
这个方法其实不好,上面的好一些
http://ruby-china.org/topics/2010