Sublime Forum

Setting build path under OS X

#1

Hi, I have just purchased a licence for ST3, since it seems to be the best option for Elixir at the moment.

Installed it under OS X V10.11.1 El Capitan. Unfortunately, when I try to build an Elixir app, using Cmd-B I get the error:

[Errno 2] No such file or directory: ‘elixir’
[cmd: [‘elixir’, ‘’]]
[dir: /Users/klaus/Library/Application Support/Sublime Text 3/Packages]
[path: /usr/bin:/bin:/usr/sbin:/sbin:/opt/node_moduler/bin/]
[Finished]

Now, I know that the elixir application is in my /usr/local/bin directory, so I modified Preferences.sublime-settings as shown below:

{
“color_scheme”: “Packages/User/SublimeLinter/Monokai (SL).tmTheme”,
“ignored_packages”:
[
“Vintage”
],
“paths”:
{
“linux”:
[
],
“osx”:
[
“/usr/local/bin”
],
“windows”:
[
]
}
}

I tried looking at the solutions posted here: [ST3][El Capitan] SASS build fails with Errno 2 but couldn;t find an elixir.sublime-build file :frowning:

Unfortunately, my attempt to solve the problem doesn’t seem to have fixed things for me. Can somebody explain what I’m doing wrong? I have seen that an add-on package exists to address this issue, but I’d rather do it the standard way if at all possible. Not trying to be offensive, but it seems to me that ST is meant to be highly configurable :wink:

0 Likes

#2

It is. But you need to know all the places where you can tinker and there are quite a lot of them…

What package for Elixir do you use? Sublime doesn’t have a default one for that.

0 Likes

#3

Try with this package installed: https://packagecontrol.io/packages/Fix%20Mac%20Path

0 Likes

#4

It’s called ‘ElixirSublime’.

0 Likes

#5

Thanks @FichteFoll but that’s the add-on tray I was referring to. I’d rather not use add-ons if I can do it using the standard Sublime configuration mechanism. Obviously, is this isn’t possible then I’ll revert to using the add-on.

0 Likes

#6

I think it’s this one, since ElixirSublime only do completions.[quote=“Klaus_K, post:5, topic:16624”]
I’d rather not use add-ons if I can do it using the standard Sublime configuration mechanism.
[/quote]
Well, in this case you need to fix mistakes made by plugin’s author so it’s not “standard Sublime configuration mechanism” per se. But the author did use it to make a plugin in the first place so it’s almost the same.

Packages installed via package control can be found here:

~/Library/Application Support/Sublime Text 3/Installed Packages

There should be one for Elixir. The elixir.sublime-build is in it, it’s just a zip. You need to override it and use the fix you’ve mentioned. Read here now to override a file or use PackageResourceViewer to do the same thing.

0 Likes

#7

BTW, I will use another way to fix sublime-build file. Instead of

"cmd": ["elixir", "$file"],

I will put

"shell_cmd": "elixir $file",

This way Sublime will start Elixir via Bash. If the latter has a correct PATH variable it will work without a need to provide the same path to Sublime.

0 Likes

#8

Hmmm - I made this ‘shell_cmd’ mod to the sublime-build file but the cmd displayed in the euro window didn’t change. In fact, I found the change was made to two copies of this file - one under “Packages” and the other under “Installed Packages”.

Not sure why there’s two copies - it may be that the PackageResourceViewer makes a copy? Anyways, I’ll try and spend more time on this tomorrow :slightly_smiling: So near, yet so far :wink:

0 Likes

#9

OK, my bad - I finally gave up doing it the ‘official’ way and used FixMacPath add-on instead. So simple :slight_smile: Many thanks folks :sunny:

0 Likes

#10

You can add this to a build definition:

“path”: “/bin:/usr/bin:/usr/local/bin”

0 Likes