我通过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正常工作,我错过了什么?
答案 0 :(得分:2)
我遇到了同样的错误,您的宝石路径有问题,通过在SublimeREPL的用户设置中添加以下内容进行修复:(首选项 - &gt;套餐设置 - &gt; SublimeREPL - &gt;用户)
{
// 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}"
}
}
如果无效,您可以从here
获取更多信息