Ruby:错误:无法找到此方法:String.

Sno*_*ash 3 ruby pry

任何想法,为什么当使用某些文件不工作show-docpry?例如,见show-docStringArray相比,Set在这里:

show-doc Set

From: /Users/snowcrash/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/set.rb @ line 3:
Class name: Set
Number of lines: 57

--
set.rb - defines the Set class
++
Copyright (c) 2002-2008 Akinori MUSHA <knu@iDaemons.org>

Documentation by Akinori MUSHA and Gavin Sinclair.

All rights reserved.  You can redistribute and/or modify it under the same
terms as Ruby.

  $Id: set.rb 37839 2012-11-24 18:51:45Z knu $

== Overview

This library provides the Set class, which deals with a collection

show-doc String
Error: Cannot locate this method: String.
[7] pry(main)> show-doc Array
Error: Cannot locate this method: Array.
Run Code Online (Sandbox Code Playgroud)

Sac*_*ngh 7

尝试安装pry-doc gem:

gem install pry-doc
Run Code Online (Sandbox Code Playgroud)

要么

按@JayKilleen

如果你在rails环境中使用pry,你也可以尝试安装jazz_hands而不是github.com/nixme/jazz_hands,这会将pry和其他gem功能带入rails控制台.

  • 我已经安装了 pry-doc 但仍然有这个问题。只是试图跟随 Josh Cheek 的介绍性截屏视频,但无法跳过第一个“show-doc s.each_line”http://vimeo.com/26391171 (2认同)