iie labs

Textmate Ruby 1.9.1 and rvm - the facts

Posted almost 11 years ago by Philip Ingram

boy, I almost went to macVim because of this error. /me shudders.

Note: this solution appears to work for Mac’s that can’t run in Snow Leopard in full 64 bit mode. Here is my uname on my box:

$ uname -a
Darwin macbook.local 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov  3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386

Google Bait: Errors i got

So here is the final error i got in the end that brought all of this together

macbook:Bundles nerb$ osascript -e 'tell app "TextMate" to reload bundles' 2010-02-11 09:14:54.925 osascript[91871:903] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find: /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper osascript: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers.

You are trying to get RVM, Ruby 1.9.1 and the Textmate w/Ruby on Rails bundle to work.

  • You’ve installed rvm and are using Ruby version 1.9.1 – No steps here, google is your friend.
  • You are getting weird Textmate snippet errors – Things that worked before are now botched. It’s because of the ruby on Rails tmbundle that you’ve yet to update.

Steps to fix

Well, it was another Wayne E. Seguin impromptu script that came through for me. Praise be unto him.

  1. First be sure your textmate is latest version
  1. Then run the script below to make sure that your textmate bundles are up to date (you may have to run it as root depending on your permissions).
    #!/usr/bin/env bash

mkdir -p /Library/Application\ Support/TextMate/
cd /Library/Application\ Support/TextMate/

if [[ -d Bundles/.svn ]] ; then
cd Bundles && svn up
if [[ -d Bundles ]] ; then
mv Bundles Bundles.old
svn co http://svn.textmate.org/trunk/Bundles

arch -i386 osascript -e ‘tell app “TextMate” to reload bundles’

exit 0

  1. Set a textmate rvm ruby:
    rvm 1.9.1 --symlink textmate
  1. Then go to Textmate | Preferences | Advanced | Shell Variables, click the + sign and add this variable (change YOURUSERNAME to your real user name)
    TM_RUBY to /Users/YOURUSERNAME/.rvm/bin/textmate
  1. Close textmate and re-open it after to be sure everything is correct.

If it doesn’t work:

Perhaps you missed the uname line at the top and you are lucky enough to be running Snow Leopard in a native 64 bit environment, cough prick cough. Well just run this last line of the script without the "arch -i386 " bit.

macbook:Bundles $ osascript -e 'tell app "TextMate" to reload bundles'

If that still doesn’t work:

Perhaps you’ll need a new Ruby on Rails tmbundle.

Follow the instructions to download and when you run the osascript line at the bottom, adjust it to use the ‘arch -i386’ flag as we do in the script. Again, assuming you’ve got a uname similar to mine.

Hope it helps.


blog comments powered by Disqus