Hi, all.
I've just started to use TextMate & I'm wondering how to get it to recognise the Ruby version I use.
I've altered my $PATH in TM's Prefs to reflect the change, Terminal shows:
[Mon Nov 14 20:00:55 dobbin@darkstar:~ ] $ which ruby /usr/local/rvm/rubies/ruby-1.9.3-p0/bin/ruby
but running the example script even with a shebang line returns this:
#!/usr/local/rvm/rubies/ruby-1.9.3-p0/bin/ruby
RUBY_VERSION # => "1.8.7" data = %w[one two three four five] results = data.select { |n| n[0] == ?t } # => ["two", "three"]
Any help appreciated.
Cheers,
Phil...
Hi Phil, Preferences>Advanced>Shell Variables
add the following variable/value pair:
TM_RUBY /Path/to/ruby
if you use ruby version manager you can add:
TM_RUBY /Users/username/.rvm/bin/rvm-auto-ruby
which will automatically detect which version RVM is set to use and use that one in textmate. Tim
On Mon, Nov 14, 2011 at 12:38 PM, Phil Dobbin phildobbin@gmail.com wrote:
Hi, all.
I've just started to use TextMate & I'm wondering how to get it to recognise the Ruby version I use.
I've altered my $PATH in TM's Prefs to reflect the change, Terminal shows:
[Mon Nov 14 20:00:55 dobbin@darkstar:~ ] $ which ruby /usr/local/rvm/rubies/ruby-1.9.3-p0/bin/ruby
but running the example script even with a shebang line returns this:
#!/usr/local/rvm/rubies/ruby-1.9.3-p0/bin/ruby
RUBY_VERSION # => "1.8.7" data = %w[one two three four five] results = data.select { |n| n[0] == ?t } # => ["two", "three"]
Any help appreciated.
Cheers,
Phil...
-- Nothing to see here... move along, move along
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 14/11/11 21:04, "Tim Rand" timrandg@gmail.com wrote:
Preferences>Advanced>Shell Variables
add the following variable/value pair:
TM_RUBY /Path/to/ruby
if you use ruby version manager you can add:
TM_RUBY /Users/username/.rvm/bin/rvm-auto-ruby
which will automatically detect which version RVM is set to use and use that one in textmate.
Hi, Tim.
It still doesn't see the rvm version & returns the System version.
I'm getting:
`/usr/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/open3.rb:202: warning: Insecure world writable dir /usr/local in PATH, mode 04077`
But that's because I chmod'd a couple of Cache directories in /usr/local/ to 777 so they could be writable to by apapche 2.2. I don't think that can be the cause because I did the same in /opt/local/ where my working copy of perl is & TM returns any output from any script fine if I supply the correct shebang line `/opt/local/bin/perl`
Puzzled...
Cheers,
Phil.
Hi again Phil, RVM/textmate interface can be tricky to set up. How about just feeding the path to the version you want to use directly to the TM_RUBY variable. So for instance, use the full path for the ruby you want textmate to use, rather than relying on the rvm-auto-ruby to tell it.
TM_RUBY /Users/timrand/.rvm/rubies/macruby-0.10/bin/ruby
Be sure to uncheck any other TM_RUBY variables that you have listed. Only check the one that you want to use immediately. Then try the following in a textmate window: p RUBY_VERSION
in textmate and look at the output to verify the correct version is being used. See the line in the purple region of the output screen it reads "macruby" Regards, Tim
On Mon, Nov 14, 2011 at 2:04 PM, Phil Dobbin phildobbin@gmail.com wrote:
On 14/11/11 21:04, "Tim Rand" timrandg@gmail.com wrote:
Preferences>Advanced>Shell Variables
add the following variable/value pair:
TM_RUBY /Path/to/ruby
if you use ruby version manager you can add:
TM_RUBY /Users/username/.rvm/bin/rvm-auto-ruby
which will automatically detect which version RVM is set to use and use
that
one in textmate.
Hi, Tim.
It still doesn't see the rvm version & returns the System version.
I'm getting:
`/usr/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/open3.rb:202: warning: Insecure world writable dir /usr/local in PATH, mode 04077`
But that's because I chmod'd a couple of Cache directories in /usr/local/ to 777 so they could be writable to by apapche 2.2. I don't think that can be the cause because I did the same in /opt/local/ where my working copy of perl is & TM returns any output from any script fine if I supply the correct shebang line `/opt/local/bin/perl`
Puzzled...
Cheers,
Phil.
Nothing to see here... move along, move along
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 14/11/11 23:58, "Tim Rand" timrandg@gmail.com wrote:
RVM/textmate interface can be tricky to set up. How about just feeding the path to the version you want to use directly to the TM_RUBY variable. So for instance, use the full path for the ruby you want textmate to use, rather than relying on the rvm-auto-ruby to tell it.
TM_RUBY /Users/timrand/.rvm/rubies/macruby-0.10/bin/ruby
Be sure to uncheck any other TM_RUBY variables that you have listed. Only check the one that you want to use immediately. Then try the following in a textmate window: p RUBY_VERSION
in textmate and look at the output to verify the correct version is being used. See the line in the purple region of the output screen it reads "macruby"
Hi, Tim.
Many thanks for that. I'd tried both shell variables (using rvm & /path/to/ruby) but the script still returned the System version.
I'd just installed rcodetools & copied the vim plugin to run the script in vim but just in time I saw your post. `p RUBY-VERSION` returns the correct 1.9.3 version & x86_64-darwin10.8.0 as you'd expect on Snow Leopard.
Once again, thanks for sticking with me.
Cheers,
Phil...