1

I'm trying to get a build system for the Jekyll gem in sublime text. In my sublime-project I have the following:

  "build_systems":
  [
    {
      "name":"jekyll",
      "cmd":"/Users/kaass/.rvm/gems/ruby-1.9.3-p327/bin/jekyll",
      "shell":true,
      "path":"/Users/kaass/.rvm/bin/rvm-auto-ruby",
      "working_dir":"$project_path"
    }
  ]

I have tried playing around with env as well as different options above, but always get some sort of error pertaining to ruby or jekyll not found or env: ruby_noexec_wrapper not found

I'm running 10.8.2 and my path :

kaass:~ kaass$ echo $PATH
/Users/kaass/.rvm/gems/ruby-1.9.3-p327/bin:/Users/kaass/.rvm/gems/ruby-1.9.3-p327@global/bin:/Users/kaass/.rvm/rubies/ruby-1.9.3-p327/bin:/Users/kaass/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/bin:/usr/X11R6/bin

Everything I'm trying to call is already in my path.

Kassym Dorsel
  • 4,773
  • 1
  • 25
  • 52
  • I have had a hard time with ST2 and the PATH it uses when it starts up. I ended up adding the .rvm bin directories to my $PATH (ruby, gem, and global), which helped me. Not sure at all if this will help you. – AGS Dec 05 '12 at 00:28
  • Updated questions with my path. Unless ST2 modifies the path or finds it elsewhere I should have no problem there. – Kassym Dorsel Dec 05 '12 at 16:50

1 Answers1

2

I had a similar problem running rake within the correct rvm environment. This is the sublime-project file I ended up with:

{
  "folders":
  [
    {
      "path": "data"
    }
  ],
  "build_systems":
  [
    {
      "name": "rake",
      "cmd": "source ~/.rvm/environments/ruby-1.9.3-p194@mygemset && rake",
      "shell": true,
      "path": "/bin:/usr/bin:/usr/local/bin:~/.rvm/bin",
      "working_dir": "$project_path"
    }
  ]
}

The trick was to add ~/.rvm/bin to the path and to source the environment of the rvm gemset. Then I can even use the "rake" command without specifying a full path. The rest is straight-forward.

Lysann Schlegel
  • 886
  • 10
  • 16
  • I used a slightly different `"cmd":"source /Users/kaass/.rvm/environments/default && jekyll"` – Kassym Dorsel Dec 07 '12 at 17:14
  • There seems to be common confusion about Sublime paths. The path as seen by build systems started by Sublime is **not** the same as the PATH in your shell. – dbn Dec 15 '12 at 02:20