On Sunday June 03 2012, John Yeates textmate2@warmvomit.co.uk wrote:
#!/usr/bin/env ruby
puts RUBY_VERSION
…and that I'm setting TM_RUBY = "/Users/myname/.rvm/bin/ruby-1.9.3-p0@primes" in the .tm_properties for the project, hitting Cmd-R in the script window shows 1.8.7. Running it from the command-line shows the expected 1.9.3.
Hm — further experiments show that if I delete the shebang from the script, it runs using TM_RUBY and shows 1.9.3 (but will break for people running it from the command line). If I point the shebang at /Users/myname/.rvm/bin/ruby-1.9.3-p0@primes, it again shows 1.9.3 (but will break for people not on my machine, or on my machine but without read access to that binary).
So it's not as bad as I thought, but there still isn't a "set it and forget it" solution — and, of course, I still need to specify the binary explicitly in the .tm_properties.