I reformatted and reinstalled Mountain Lion recently, and the new versions of Jekyll and/or Ruby and/or Ant broke my workflow. I use Sublime Text 2 to call an Ant build script which (among other commands) executes Jekyll to build a blog.
Here's my Sublime Text project file:
"build_systems":
[
{
"name": "MyBlog",
"cmd": ["ant"],
"working_dir": "/Users/JordanRoher/Dropbox/Projects/BlogFolder/Web/www",
"variants": [
{ "cmd": ["ant", "local"],
"name": "Local"
},
{ "cmd": ["ant", "remote"],
"name": "Remote"
}
]
}
]
The Ant command looks like this:
<target name="jekyll">
<exec dir="${dir.source}" executable="bash">
<env key="PATH" path="/usr/local/opt/ruby/bin"/>
<env key="LC_ALL" value="en_US.UTF-8"/>
<env key="LANG" value="en_US.UTF-8"/>
<arg value="-c"/>
<arg value="jekyll build"/>
</exec>
</target>
Last year that used to work, but now it produces this output:
jekyll:
[exec] bash: jekyll: command not found
[exec] Result: 127
At which point the whole build script goes off the rails.
Important to note that if I run the ant command from the project folder, ant and this taget work fine. It's only Sublime Text that's causing a problem.
I've also tried a different style of Ant command, like so:
<target name="jekyll">
<exec dir="${dir.source}" executable="jekyll">
<arg value="build"/>
</exec>
</target>
But this creates a different kind of error:
Execute failed: java.io.IOException: Cannot run program "jekyll": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:470)
A little about my system:
$ echo $PATH
/Users/JordanRoher/.rvm/gems/ruby-1.9.3-p429/bin:/Users/JordanRoher/.rvm/gems/ruby-1.9.3-p429@global/bin:/Users/JordanRoher/.rvm/rubies/ruby-1.9.3-p429/bin:/Users/JordanRoher/.rvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Should I add PATH variables to the Sublime Text build script? If so, which ones?