Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TextMate, rvm and TM_RUBY

Tags:

ruby

rvm

textmate

In the TextMate RVM instructions the text it says to set TM_RUBY to /Users/wayne/.rvm/bin/textmate_ruby and in the image it shows it set to rvm-auto-ruby. I decided to set it to rvm-auto-ruby thinking that it would use RVM's default Ruby version.

When running Command R in the RSpec.bundle having TM_RUBY set to rvm-auto-ruby will result in a load error. When you set it to textmate_ruby it works.

The only problem here is that TextMate doesn't always use the default version of Ruby since it's hardcoded in that file.

/Users/jspooner/.rvm/bin/textmate_ruby:

#!/usr/bin/env bash

if [[ -s "/Users/jspooner/.rvm/environments/ruby-1.9.2-head" ]] ; then
  source "/Users/jspooner/.rvm/environments/ruby-1.9.2-head"
  exec ruby "$@"
else
  echo "ERROR: Missing RVM environment file: '/Users/jspooner/.rvm/environments/ruby-1.9.2-head'" >&2
  exit 1
fi

So two questions:

  1. What should TM_RUBY=rvm-auto-ruby actually do?
  2. Is there a way to have TextMate use the RVM default?
like image 840
jspooner Avatar asked Nov 30 '10 19:11

jspooner


1 Answers

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.

like image 131
tek_yogi Avatar answered Oct 07 '22 10:10

tek_yogi