从 Textmate 查找 Ruby RI 文档
我在 Textmate 中查找 Ruby 文档时遇到问题。 我将 Ruby 1.9.1 安装到 /usr/local/bin,但是当我使用 Ctrl+H 使用 Ruby 包查找单词时,出现以下错误:
/Users/joshuaaburto/Library/Application Support/TextMate/Pristine Copy/Support/lib/web_preview.rb:101:警告:98 /usr/local/lib/ruby 处的“end”与“if”缩进不匹配/1.9.1/rdoc/ri/driver.rb:661:in
initialize': 权限被拒绝 - /Users/joshuaaburto/.ri/cache/ActionController-Base (Errno::EACCES) 来自 /usr/local/ lib/ruby/1.9.1/rdoc/ri/driver.rb:661:in
从 /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:661:in 打开write_cache' 来自 /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:507:in
create_cache_for' 来自 /usr/local/lib/ruby/1.9.1/ rdoc/ri/driver.rb:469:inload_cache_for' from /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:648:in
块(2 级)在 select_methods' 中 /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:647:ineach' 中 /usr/local/lib/ruby/1.9.1/rdoc/ri /driver.rb:647:in
grep' from /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:647:inblock in select_methods' from /usr/ local/lib/ruby/1.9.1/rdoc/ri/driver.rb:646:in
each' 来自 /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:646 :inselect_methods' from /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:624:in
block in run' from /usr/local/lib/ruby/ 1.9.1/rdoc/ri/driver.rb:590:ineach' from /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:590:in
运行' 来自 /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:300:inrun' 来自 /usr/local/bin/ri:5:in
'< /p>
谁能告诉我如何正确编辑 RI 权限或 Ruby textmate 包以使用文档功能?
I'm having trouble looking up documentation for Ruby in Textmate. I installed Ruby 1.9.1 to /usr/local/bin but when I use Ctrl+H
to lookup a word using the Ruby bundle I get this error:
/Users/joshuaaburto/Library/Application Support/TextMate/Pristine Copy/Support/lib/web_preview.rb:101: warning: mismatched indentations at 'end' with 'if' at 98 /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:661:in
initialize': Permission denied - /Users/joshuaaburto/.ri/cache/ActionController-Base (Errno::EACCES) from /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:661:in
open' from /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:661:inwrite_cache' from /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:507:in
create_cache_for' from /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:469:inload_cache_for' from /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:648:in
block (2 levels) in select_methods' from /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:647:ineach' from /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:647:in
grep' from /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:647:inblock in select_methods' from /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:646:in
each' from /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:646:inselect_methods' from /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:624:in
block in run' from /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:590:ineach' from /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:590:in
run' from /usr/local/lib/ruby/1.9.1/rdoc/ri/driver.rb:300:inrun' from /usr/local/bin/ri:5:in
'
Could anyone advise me on how to properly edit the RI permissions or the Ruby textmate bundle in order to use the documentation feature?
通过用空格替换“end”单词前面的制表符(以匹配第 98 行中“if”的“缩进符号”),可以轻松解决缩进问题。 只需编辑“/Users/joshuaaburto/Library/Application Support/TextMate/Pristine Copy/Support/lib/web_preview.rb”文件,第 101 行,如其所述。
然而,另一个问题出现了(至少对我来说):下次调用文档查找时 TextMate 会“冻结”(按 Ctrl-C 释放它)。 在 Ctrl-C“解冻”之后,TextMate 说:“旧式 plist 解析器错误:第 1 行出现意外字符“0x300”:/Applications/TextMate.app/Contents/SharedSupport/Support/lib/ui.rb:182
也许是这样是因为我这里没有用 ruby 1.9.1 编译 Cocoa 或者其他什么。
The problem with the indentation can be easily solved by replacing the tab symbol in front of that 'end' word with spaces (to match the "indentation symbols" of 'if' in line 98). Just edit your "/Users/joshuaaburto/Library/Application Support/TextMate/Pristine Copy/Support/lib/web_preview.rb" file, line 101, as it says.
However, another problem arises there (with me, at least): TextMate "freezes" next time you invoke the documentation look-up (press Ctrl-C to release it). Following Ctrl-C "unfreezing", TextMate says: "Old-style plist parser error: Unexpected character '0x300' at line 1: /Applications/TextMate.app/Contents/SharedSupport/Support/lib/ui.rb:182
Maybe this is because I don't have Cocoa compiled with ruby 1.9.1 here or something.