使用pry调试Homebrew脚本

时间:2012-10-23 09:45:48

标签: ruby homebrew pry

gem list显示:

*** LOCAL GEMS ***

bundler (1.1.5)
coderay (1.0.8)
method_source (0.8.1)
pry (0.9.10)
slop (3.3.3)

然而,似乎如果我进入任何Homebrew文件,并执行:

require 'pry'

我明白了:

Error: no such file to load -- pry
Please report this bug:
    https://github.com/mxcl/homebrew/wiki/troubleshooting
/usr/local/Library/Homebrew/formula_installer.rb:2:in `require'
/usr/local/Library/Homebrew/formula_installer.rb:2
/usr/local/Library/Homebrew/cmd/install.rb:1:in `require'
/usr/local/Library/Homebrew/cmd/install.rb:1
/usr/local/bin/brew:51:in `require'
/usr/local/bin/brew:51:in `require?'
/usr/local/bin/brew:93

即使我尝试使用硬编码路径,我也会得到:

Error: no such file to load -- /Users/patrick/.rvm/gems/ruby-1.9.3-p194@global/bin/pry

即使它确实存在......

patrick@vincent:/usr/local/Library/Homebrew(master)>ls -l /Users/patrick/.rvm/gems/ruby-1.9.3-p194@global/bin/pry
-rwxr-xr-x  1 patrick  staff  480 Oct 23 02:32 /Users/patrick/.rvm/gems/ruby-1.9.3-p194@global/bin/pry

我可以进入irb并执行require 'pry'并且它可以正常工作。发生了什么事?

1 个答案:

答案 0 :(得分:0)

啊哈..我需要'rubygems'