TextMate, rvm and TM_RUBY

我怕爱的太早我们不能终老 提交于 2019-11-30 10:01:39
the Tin Man

See your other, similar, question Rspec bundle is broken in TextMate and rvm.


To help others chasing this same issue, the solution seems to be at: RVM / Textmate doesnt recognize .rvmrc Options.

Basically you replace the ~/.rvm/bin/textmate_ruby soft link with a file. This is what I did:

  1. cd ~/.rvm/bin
  2. mv textmate_ruby old.textmate_ruby
  3. Create a shell script called textmate_ruby in the same directory to replace the soft-link, using the following contents:
    
    

    !/usr/bin/env sh

    source ~/.rvm/scripts/rvm cd . exec ruby "$@"
  4. chmod +x textmate_ruby

Before doing this change I'd see my system Ruby's version (1.8.7) displayed if I did CMD+R to run the following script in TextMate:

puts RUBY_VERSION

Evaluating the script using CMD+CNTRL+SHIFT+E gave me 1.9.2.

After switching to use that script both point to Ruby 1.9.2, so at least there's some consistency now. I don't see TextMate tracking my currently set RVM Ruby version yet; Instead it's using the default version set in RVM: rvm use 1.9.2 --default. This is still a step forward because I can control which Ruby TextMate uses by adjusting my --default.

If you decide you want to revert later, just rename, or delete, the script and reverse step 2 above.

tek_yogi

Setting TM_RUBY to your-path/rvm-auto-ruby

http://rvm.io/integration/textmate/

should load whatever ruby and gemset is indicated in the .rvmrc file located in the project and if none default to rvm default. I just got this working and it is very smooth. I did need to get the latest version of rvm

rvm get head

to make it work and restart Textmate. Hope that helps.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!