tech
Ruby on Rails: When Textmate Breaks
Friday, November 13th, 2009 | tech | No Comments
After installing Ruby 1.8.7 on my shiny iMac, Textmate decided that it no longer knew where the Ruby environment was. Oh, it knew where Ruby was, and would run Ruby scripts just fine, but whenever I tried to use anything from any bundle, all I got was:
“env: ruby: No such file or directory”
Maddening.
Turns out I didn’t have a environment.plist file in my /Users/(username)/.MacOSX/ directory, and even though it worked just fine before without it, that was no longer the case.
Here’s where to get a nifty little Ruby script to build it and even stick it in the right place for you. Note, the file must already exist, so you’ll have to make a .MacOSX directory in your user directory, and create an empty file “environment.plist.”
Ruby on Rails: Autocomplete with jQuery error: “Couldn’t find FileData with ID”
Monday, June 8th, 2009 | tech | No Comments
Just in case anyone else has this problem and does not want to bang their head against the wall for an hour like I did:
When using the autocomplete plugin that uses jQuery instead of scriptaculous, you need to add a route:
map.auto_complete ':controller/:action',
:requirements => { :action => /auto_complete_for_\S+/ },
:conditions => { :method => :get }
As per this post by the author of the plugin, who for some unknown reason hasn’t included that step with the instructions for the plugin. (WTF?) Otherwise it just sends the request to the show action, which looks at you stupidly and replies, “Couldn’t find FileData with ID=auto_complete_for_yourfieldname”, replacing “yourfieldname” with whatever you’d actually like it to return.