5

What is the best way to setup Textmate 2 to use rbenv?

I read a Textmate mailing list thread about setting up rbenv but haven't found the right solution yet.

David J.
  • 31,569
  • 22
  • 122
  • 174

4 Answers4

8

Update your ~/.tm_properties to include:

TM_RUBY = "$HOME/.rbenv/shims/ruby"
PATH = "$HOME/.rbenv/bin:$PATH"

Thanks to uberfork for this helpful article: Integrate rbenv with Textmate.

Swanand
  • 12,317
  • 7
  • 45
  • 62
David J.
  • 31,569
  • 22
  • 122
  • 174
6

The answers supplied here didn't work for me. Here's what did:

  1. Preferences -> Variables
  2. add this to the front of PATH: $HOME/.rbenv/bin:$HOME/.rbenv/shims:
  3. set TM_RUBY to this: $HOME/.rbenv/shims/ruby
  4. populate RBENV_VERSION with your version. example: 2.1.0-preview1
  5. (and make sure the checkboxes for each of those variables are selected)
elitalon
  • 9,191
  • 10
  • 50
  • 86
John Bachir
  • 22,495
  • 29
  • 154
  • 227
3

For me adding /usr/local/var/rbenv/shims to TextMate's PATH variable did the trick.

PATH TextMate variable looks like this /usr/local/var/rbenv/shims:$PATH:/opt/local/bin:/usr/local/bin:/usr/texbin.

Mirek Rusin
  • 18,820
  • 3
  • 43
  • 36
1

Just to supplement all answers above - if you would like to use different ruby version per project just create a new .tm_properites file inside root of the project with the correct RBENV_VERSION variable.

Lucas
  • 502
  • 1
  • 5
  • 15