参考:Rubyistよ、irbを捨ててPryを使おう - TIM Labs
mini:~ foo$ gem install pry pry-doc Fetching: coderay-1.0.9.gem (100%) Fetching: slop-3.4.4.gem (100%) Fetching: method_source-0.8.1.gem (100%) Fetching: pry-0.9.12.gem (100%) Successfully installed coderay-1.0.9 Successfully installed slop-3.4.4 Successfully installed method_source-0.8.1 Successfully installed pry-0.9.12 Fetching: yard-0.8.5.2.gem (100%) Fetching: pry-doc-0.4.5.gem (100%) Successfully installed yard-0.8.5.2 Successfully installed pry-doc-0.4.5 6 gems installed Installing ri documentation for coderay-1.0.9... unable to convert U+00E4 from UTF-8 to US-ASCII for lib/coderay/scanners/php.rb, skipping unable to convert U+00E4 from UTF-8 to US-ASCII for lib/coderay/scanners/ruby/patterns.rb, skipping unable to convert "\xC3" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII for README_INDEX.rdoc, skipping Installing ri documentation for slop-3.4.4... Installing ri documentation for method_source-0.8.1... unable to convert "\xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII for lib/method_source.rb, skipping Installing ri documentation for pry-0.9.12... RDoc::Parser::Ruby failure around line 25 of lib/pry/commands/ls.rb Before reporting this, could you check that the file you're documenting has proper syntax: /Users/foo/.rbenv/versions/1.9.3-p194/bin/ruby -c lib/pry/commands/ls.rb RDoc is not a full Ruby parser and will fail when fed invalid ruby programs. The internal error was: (NoMethodError) undefined method `name' for #<RDoc::RubyToken::TkDOT:0x007f9327027490> ERROR: While generating documentation for pry-0.9.12 ... MESSAGE: undefined method `name' for #<RDoc::RubyToken::TkDOT:0x007f9327027490> ... RDOC args: --ri --op /Users/foo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/doc/pry-0.9.12/ri lib --title pry-0.9.12 Documentation --quiet
なんかちょっと怒られた。でもRDoc関係と思うことにして無視しておくw
mini:~ foo$ gem list *** LOCAL GEMS *** bigdecimal (1.1.0) coderay (1.0.9) faraday (0.8.1) io-console (0.3) json (1.5.4) method_source (0.8.1) minitest (2.5.1) multi_json (1.3.6) multipart-post (1.1.5) nokogiri (1.5.5) pry (0.9.12) pry-doc (0.4.5) rake (0.9.2.2) rdoc (3.9.4) simple_oauth (0.1.9) slop (3.4.4) sqlite3 (1.3.6) twitter (3.4.0) yard (0.8.5.2)
さて実行してみる。
mini:~ foo$ pry -bash: pry: command not found
あれ?
(続いて管理者でも同様にインストールするが、やはり動かない)
なんでかな?
と思ったら再度ログインしたら動いたw