简体   繁体   English

TextMate 不适用于当前的 Ruby/Rails?

[英]TextMate not working with current Ruby/Rails?

I'm trying, desperately, to get TextMate (via drnic's Ruby on Rails.tmbundle )to take me to Rails source when I highlight a term.当我突出显示一个术语时,我正在拼命地尝试让 TextMate(通过 Rails.tmbundle 上的Ruby on Rails.tmbundle )带我到 Rails 源。 Supposedly I can highlight a function and type control-f (^f) but when I do I just get a yellow sheet full of errors (below).假设我可以突出显示 function 并键入 control-f (^f) 但是当我这样做时,我只会得到一张充满错误的黄色表格(如下)。 Anyone know how to fix?有谁知道如何解决? and/or a better way to quickly get to source of a gem?和/或快速获得宝石来源的更好方法?

NOTE: Gem.latest_load_paths is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem.latest_load_paths called from /Users/meltemi/Library/Application Support/TextMate/Bundles/Ruby on Rails.tmbundle/Support/bin/jump_to_method_definition.rb.72.
NOTE: Gem.all_partials is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem.all_partials called from /Users/meltemi/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:600.
    from /Users/meltemi/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:423:in `each'
    from /Users/meltemi/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:423:in `each'
    from /Users/meltemi/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:587:in `each'
    from /Users/meltemi/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:586:in `each'
    from /Users/meltemi/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:586:in `each'
    from /Users/meltemi/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb/deprecate.rb:62:in `block (2 levels) in deprecate'
    from /Users/meltemi/Library/Application Support/TextMate/Bundles/Ruby on Rails.tmbundle/Support/bin/jump_to_method_definition.rb:72:in `find_in_gems'
    from /Users/meltemi/Library/Application Support/TextMate/Bundles/Ruby on Rails.tmbundle/Support/bin/jump_to_method_definition.rb:108:in `find_method'
    from /Users/meltemi/Library/Application Support/TextMate/Bundles/Ruby on Rails.tmbundle/Support/bin/jump_to_method_definition.rb:115:in `find'
    from /Users/meltemi/Library/Application Support/TextMate/Bundles/Ruby on Rails.tmbundle/Support/bin/jump_to_method_definition.rb:17:in `initialize'
    from /Users/meltemi/Library/Application Support/TextMate/Bundles/Ruby on Rails.tmbundle/Support/bin/jump_to_method_definition.rb:147:in `new'
    from /Users/meltemi/Library/Application Support/TextMate/Bundles/Ruby on Rails.tmbundle/Support/bin/jump_to_method_definition.rb:147:in `<main>'

Using:使用:

  • TextMate : 1.5.10文本伴侣: 1.5.10
  • Rails : 3x (tried with 3.0.7, 3.1.rc1, 3.1.rc3) Rails :3x(尝试使用 3.0.7、3.1.rc1、3.1.rc3)
  • RVM : 1.6.20 RVM :1.6.20
  • Ruby on Rails.tmbundle : HEAD Ruby on Rails.tmbundle : HEAD

It used to work with system Ruby (2.3.x).它曾经与系统 Ruby (2.3.x) 一起使用。 But when I set TextMate's TM_RUBY shell variable to: /Users/meltemi/.rvm/bin/rvm-auto-ruby in TextMate advanced prefs as per these instructions ...things broke.但是,当我按照这些说明在 TextMate 高级首选项中将 TextMate 的TM_RUBY shell 变量设置为: /Users/meltemi/.rvm/bin/rvm-auto-ruby时……事情就坏了。

I had the same problem and fixed it: You need to update the TextMate configured path at TM_RUBY to a ruby path in RVM that is compatible.我遇到了同样的问题并修复了它:您需要将 TM_RUBY 处的 TextMate 配置路径更新为 RVM 中兼容的 ruby 路径。 For me:为了我:

.../.rvm/rubies/ruby-1.9.3-p327/bin/ruby

works as a compatible version of Ruby for TextMate, for example.例如,用作 TextMate 的 Ruby 的兼容版本。 You need to set it to an explicit package of Ruby in RVM, because otherwise you're letting it pick up RVM's default, which is likely further along than TextMate was tested against.您需要在 RVM 中将其设置为 Ruby 的显式 package ,否则您将让它采用 RVM 的默认值,这可能比 TextMate 测试的更远。

Do:做:

rvm list

to see what you have installed, then do:查看您已安装的内容,然后执行以下操作:

which ruby

to see what the auto-ruby is picking up.看看自动红宝石正在拾取什么。 Then pick something explicit instead of it that works.然后选择明确的东西而不是有效的东西。

I use gemedit or gem-open , whichever I think to install when I'm setting up a machine.我使用gemeditgem-open ,无论我在设置机器时想安装哪个。 They work quite well for this purpose, though I can see how it'd be nice to be able to get directly to the source in one click.它们为此目的工作得很好,尽管我可以看到能够一键直接访问源是多么好的。 Rubymine does this, too, but it's not free. Rubymine 也这样做,但它不是免费的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM