Greetings,
I recently set up a new system with RVM and ruby 1.9.2 (default) as well as 1.8.7 and Rubinius. The system ruby is currently 1.8.7.
I followed the instructions here: http://rvm.beginrescueend.com/integration/textmate/ to set up RVM and textmate to work and play nice together. These steps work and don't.
When I use the run command textmate execute the file using the correct ruby, for example the "puts RUBY_DESCRIPTION" returns the expected ruby 1.9.2. However, when I "Execute line/ selection as ruby" I still get ruby 1.8.7 (the system ruby).
Looking at the bundles the "Execute line/ selection as ruby" command starts with "#!/usr/bin/env ruby"
How should I modify the bundles such that it run the selection or line via the TM_RUBY environment variable rather than the system ruby?
Thanks! Shane http://scr.im/shaneknysh
On Dec 29, 2010, at 2:53 PM, Shane Knysh wrote:
When I use the run command textmate execute the file using the correct ruby, for example the "puts RUBY_DESCRIPTION" returns the expected ruby 1.9.2. However, when I "Execute line/ selection as ruby" I still get ruby 1.8.7 (the system ruby).
Looking at the bundles the "Execute line/ selection as ruby" command starts with "#!/usr/bin/env ruby"
How should I modify the bundles such that it run the selection or line via the TM_RUBY environment variable rather than the system ruby?
The included bundle items are designed to work with the system-supplied version of ruby, TM_RUBY is used only when running ruby scripts, etc. So it's working as designed, if change it to use 1.9 everywhere you'll see issues with some commands.
On 31 Dec 2010, at 20:38, Michael Sheets wrote:
On Dec 29, 2010, at 2:53 PM, Shane Knysh wrote:
When I use the run command textmate execute the file using the correct ruby, for example the "puts RUBY_DESCRIPTION" returns the expected ruby 1.9.2. However, when I "Execute line/ selection as ruby" I still get ruby 1.8.7 (the system ruby).
Looking at the bundles the "Execute line/ selection as ruby" command starts with "#!/usr/bin/env ruby"
How should I modify the bundles such that it run the selection or line via the TM_RUBY environment variable rather than the system ruby?
The included bundle items are designed to work with the system-supplied version of ruby, TM_RUBY is used only when running ruby scripts, etc. So it's working as designed, if change it to use 1.9 everywhere you'll see issues with some commands.
Actually the “Execute Line as Ruby” probably should use TM_RUBY since we are executing user content.
I'm not using rvm but I have ruby 1.9.2 in /usr/local/bin and stock ruby 1.8.7 in /usr/bin.
I have /usr/local/bin before /usr/bin in my .bash_profile and /usr/bin before /usr/local/bin in TextMate's PATH shell variable. /usr/bin/env ruby is then /usr/bin in TM and /usr/local/bin in bash
For my scripts, I choose which version to use with the shebang. In commands, if I want to be able to use both versions, I use TM_RUBY and change it when needed.
I don't know if it's the best way to do this, but it works. If there is a better way, I'd like to know it.