Textmate Ruby 1.9.1 and rvm - the facts
Posted 6 months 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.
- First be sure your textmate is latest version
- 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
else
if [[ -d Bundles ]] ; then
mv Bundles Bundles.old
fi
svn co http://svn.textmate.org/trunk/Bundles
fi
arch -i386 osascript -e ‘tell app “TextMate” to reload bundles’
exit 0
- Set a textmate rvm ruby:
rvm 1.9.1 --symlink textmate
- 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
- 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.
Comments
I recently switched to Ruby 1.9.1 with rvm and since I was already up-to-date with my Rails TextMate bundle, I just needed to do the symlink and set the TM_RUBY variable and all was well.
Thanks!
Recent Posts
Keeping Subscription dates tidy during February and Leap years
Testing ActiveResource - Basic Tutorial
Active Resource to Sinatra DataMapper backend
ArmRest and the tale of the No Schema Scheme
Textmate Ruby 1.9.1 and rvm - the facts
Easiest Postgres Install Ever - Mac Edition
Two Questions to Help Decide Between RDBMS, MongoDB or CouchDB
Testing Rails 3 - Just the Facts
Acts_as_snook - Creating an admin panel
Top 10 Movies of this Decade... Rebuttal
Thinking_Sphinx - Easy Setup Tutorial