Just a quickie post in case somebody else runs into this problem (and to see if anyone has a better solution).

I’m a Ruby developer part of the time, so I manage my rubies through rvm most of the time.

I’m also increasingly a writer, and one that loves him some Markdown, so I wanted to try using Brett Terpstra’s SearchLink so I don’t always have to break flow to go hunt down a URL or go back in later to add them.

However, the stock set up kept failing. And after opening up the Automator workflow file, I found the problem.

The workflow is, by default, set up as inline Ruby code using the /usr/bin/ruby path to the system Ruby install. Which meant the json gem wasn’t installed as far as that particular bit of Ruby (and the script) is concerned.

I spent a bit of time trying to just get json installed in the system Ruby before throwing up my hands and doing the following instead:

  1. Download Brett’s gist of the Ruby code.
  2. Take note of where that file lands (or put it where you’d like).
  3. which ruby in a terminal window. Take note of the value.
  4. Edit the workflow or set up a fresh one to look like the following:

Screenshot of Automator workflow

Where the first bit is the Ruby path and the second is the path to the gist.

One other odd bit

I suspect this is more a problem with the Ghost interface than Brett’s script, but when running SearchLink on text directly in the admin interface, it borks the whole thing, replacing the text with a “_”. Luckily, it’s easily undoable, but it might not hurt to have it stashed in your clipboard, or to save a draft before trying it out there.

For now, I’m writing in Byword, running SearchLink and then pasting the Markdown into Ghost.