Skip to content

Instantly share code, notes, and snippets.

@simongregory
Created August 16, 2012 10:30
Show Gist options
  • Save simongregory/3369128 to your computer and use it in GitHub Desktop.
Save simongregory/3369128 to your computer and use it in GitHub Desktop.
TextMate 2, rvm, and the ActionScript 3 bundle playing together

Get TextMate 2, the ActionScript 3 bundle and RVM playing together

For full completion functionality - where swcs are included when searching for the completions results - you need to have the 'nokogiri' and 'rubyzip' gems installed. The default ruby shipping on OS X is 1.8.7 so the easiest solution is to switch to the system default ruby and install the nokogiri and rubyzip gems there.

However the following should also work....

Assuming that

TextMate 2, rvm (with ruby 1.9.3 installed) and the AS3 bundle are installed on your machine and when you try to autocomplete an error gets thrown.

Setup

Create the gemset the ActionScript 3 bundle needs to be fully functional

rvm gemset create tmas3
rvm use 1.9.3@tmas3

Install the required gems

gem install rubyzip
gem install nokogiri

Create the rvm textmate wrapper

rvm wrapper 1.9.3@tmas3 textmate

Open TextMate preferences and set the var TM_RUBY to /Users/{YOUR_USER_NAME}/.rvm/bin/textmate_ruby

Restart TextMate and autocompletion should be working, if you suspect that swc's aren't being searched then ~/Library/Logs/TextMate ActionScript 3.log will confirm it.

@simon-lucas
Copy link

Glad to see that you are trying to support AS3 in Textmate 2. I'd be lost without it. I at last took the plunge to upgrade to Yosemite (from Snow Leopard) at work and cannot get some functions in the Textmate/as3 bundle running.

I'm trying this on Yosemite. I have the latest TM. 2.0-beta.8.5. I have installed ruby 2.2.1. I have SDK 4.6 installed in a Developer/SDKs folder I created.

Autocomplete works, but using the Import library path function does not. Import causes two errors.

Shift-Cmd-I causes the document to be emptied of all content.
Selecting import directly from the AS3 menu causes a long error beginning 'ruby: warning: -K is specified; it is for 1.8 compatibility and may cause odd behaviour'

Is there a fix for this? The Import completion is one of my mainstays for coding AS3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment