1

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?

Jordan Roher
  • 414
  • 5
  • 17

1 Answers1

1

Solved! Thank you Martin Clayton for pointing me in the right direction. Sublime Text 2 was indeed missing the path information from .bash_profile or wherever.

The solution was to get my path by going into Terminal and typing

echo $PATH

Copied this and put it into a "path" entry in my .sublime-project file

"name": "MyBlog",
"cmd": ["ant"],
"working_dir": "/Users/JordanRoher/Dropbox/Projects/BlogFolder/Web/www",
"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",

I'm also using the short version of the Jekyll target, like so:

<target name="jekyll">
    <exec dir="${dir.source}" executable="bash">
        <arg value="-c"/>
        <arg value="jekyll build"/>
    </exec>
</target>
Jordan Roher
  • 414
  • 5
  • 17