Integrate rbenv with Textmate

I recently switched from rvm to rbenv. Usually I run ruby scripts directly from Textmate, but out-of-the-box it uses the system ruby. So here is how I (after some experimenting) got Textmate to use rbenv.

Just do the following in your Textmate/Preferences/Shell-variables

  1. extend your PATH, for me this is /Users/dpree/.rbenv/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:
  2. added RBENV_VERSION, i use 1.9.2-p290
  3. added TM_RUBY = /Users/dpree/.rbenv/shims/ruby

Now my CMD+R works again :)

What I’d like to have is that Textmate just uses the .rbenv-version files in each project. But for now I’m just happy with a global Textmate-Ruby-Version :)

  1. uberfork posted this
blog comments powered by Disqus