1

我通过 PackageControl 安装了 SublimeREPL。

当我尝试在 Sublime Text 中为 ruby​​ 文件运行 SublimeREPL 时,出现以下错误:

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'pry' (>= 0) among 12 total gem(s) (Gem::LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
    from /Users/ricky/Library/Application Support/Sublime Text 2/Packages/SublimeREPL/config/Ruby/pry_repl.rb:2:in `<main>'

***Repl Closed***

以防万一,我检查了是否安装了 pry:

gem list | grep pry
pry (0.10.1, 0.10.0, 0.9.12)

为了让 SublimeREPL 正常工作,我缺少什么?

4

1 回答 1

2

我遇到了同样的错误,你的 gem 路径有问题,通过在 SublimeREPL 的用户设置中添加以下内容来修复:(Preferences -> Packages Settings -> SublimeREPL -> User)

{ 
    // default_extend_env are used to augment any environment variables
    // that should be visible for all subprocess repls launched within
    // SublimeREPL. This is a very good place to add PATH extension
    // once "PATH": "{PATH}:/home/username/mylocalinstalls/bin" or whatever
        "default_extend_env": {
        "PATH": "{HOME}/.rvm/bin/:/usr/local/bin/:{PATH}"
          }
}

如果不起作用,您可以在此处获取更多信息表

于 2014-09-02T04:43:55.420 回答