Sublime Text not finding gcc compiler - sublimetext2

I'm trying to run Make from Sublime Text 2, but getting an error:
make: arm-none-eabi-gcc: No such file or directory
This only happens from Sublime Text, when I run from Terminal, everything works fine.
I've setup .bash_profile with
export PATH="~/arm-cs-tools/bin:$PATH"
...but still no can do? How can i get ST to resolve the $PATH environment variable?

From unofficial Sublime Documentation:
On some operating systems, the value for PATH will vary from a
terminal window to a graphical application. Thus, even if the command
you are using in your build system works in the command line, it may
not work from Sublime Text. This is due to user profiles in shells.
To solve this issue, make sure you set the desired PATH so that graphical applications such as Sublime Text can find it. See the links below for more information.
Alternatively, you can use the path element in .sublime-build files to override the PATH > used to locate the executable specified in
cmd. This new value for PATH will only be in effect for as long as
your build system is running. After that, the old PATH will be
restored.
Note that while this documentation is for v1 and is deprecated, the official documentation references this passage directly here
So you should be able to define a custom path in the .sublime-build file. using the path option

Related

'gitlab-runner' is not recognized as an internal or external command,

I'm using Windows 10 and installed gitlab-runner using the Gitlab's doc.
After a successful installation and registration, I try to leave the folderI used to install (C:\Gitlab-Runner in my instance) and try to run gitlab-runner. I get the response: 'gitlab-runner' is not recognized as an internal or external command, operable program or batch file.
I am able to run without issue in the C:\Gitlab-Runner folder, but nowhere else.
Based on the documentation and tutorials I looked at, I wouldn't expect this behavior; am I supposed to?
Did you check to ensure that it was added to The windows environment. You will likely need to update the path variable to include the path that you are using to run the command.
On windows, you add to the PATH variable with the following steps (yanked from google search page):
On the Windows taskbar, right-click the Windows icon and select System.
In the Settings window, under Related Settings, click Advanced system settings. ...
On the Advanced tab, click Environment Variables. ...
Click New to create a new environment variable.
Once you've added C:/Gitlab-runner/ to PATH, I believe you should be able to invoke with gitlab-runner.
The only thing I'll add is that, for setting PATH, the last step above is most likely unnecessary, as there will already be a variable named PATH with a list of directories stored in it. Just click EDIT and add your directory to the end of the list. Be sure to add the separator that is used for the others (I believe it's a semicolon on Windows...)
Solved. I need to call C:/Gitlab-runner/gitlab-runner rather than just gitlab-runner in other directories.
Please make sure the name of the exe is correct in the folder C:\GitLab-Runner
In my situation, I have the gilab-runner.exe.exe, there was an extra .exe in the file name though its not showing in the directory.
enter image description here

PhpStorm: how to use project root variable or relative path in PhpUnit configuration?

I would like to setup PhpUnit in PhpStorm. I press 1. Edit Configurations... and would like to enter this parameter in field 2.
I am using phpunit.xml as configuration file and all want to use a relative path like:
phpunit.xml
or use project root variable like
$PROJECT_ROOT/phpunit.xml
But both options are not working for me.
Based on your screenshot (the place where you want to use it): use full path -- in project settings such path is stored relative to the project root anyway (unless you specify some file which is outside of the project, of course) and the full path then reconstructed when needed (e.g. when shown to you or when used as a parameter during tests execution).
I don't think you'll be able to achieve what you want via the project's Run/Debug configurations. What might help you is the Default configuration file setting in your default project settings, which can be used to define the PHPUnit configuration file to use by default, so you don't need to specify it via the Use alternative configuration file option in your Run/Debug configuration.
To set this, open your Default Settings window, then navigate to Languages & Frameworks -> PHP -> PHPUnit. In the Test Runner section tick the Default configuration file checkbox and specify the location where you keep your configuration file. If this file will always be in the same path relative to your project root, you can use the $PROJECT_DIR$ variable to define the project root. So if your PHPUnit configuration file is always in the root of your project, you might set this to something like $PROJECT_DIR$/phpunit.xml. When you create a new project, its Default configuration file variable will be set to the file offset from your project root, and you won't need to use the Use alternative configuration file option in your Run/Debug configuration.
If you're opening the same project in different locations on the same machine this should work for new projects without any problem, if you want to share this configuration across machines, you might need to try PHPStorm's Exporting and Importing Settings functionality.
I'm not sure if this directly solves your problem, and it's a few months late anyway, but maybe this will be useful for someone else who stumbles across this question... The above instructions were correct for my 8.0.3 installation on Linux.

How do I extend the $PATH that Sublime Text 2 uses?

I just installed Sublime-jshint (and the requisite node.js + jshint) but get this error when I try to invoke JSHint from within ST2:
[Errno 2] No such file or directory
[cmd: [u'jshint', u'PATH-TO-THE-JS-FILE-I-AM-LINTING', u'--reporter', u'/home/cmg/.config/sublime-text-2/Packages/JSHint/reporter.js']]
[dir: DIR-MY-JS-FILE-IS-IN]
[path: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/cmg/bin]
[Finished]
The final item in the given path is in the home dir of my user (cmg), so it's been customized somehow... but I don't recall how, so I don't know how to add the dir I need (~/node_modules/.bin).
I've added it to $PATH in my shell (via both .bashrc and .bash_profile) but ST2 doesn't pick it up.
(I'm on Ubuntu 14.04. All the usable stuff I've found via Google on this subject has been either OS X specific or related to ST's build system).
Basically, the exec command, which the jshint package uses internally, allows you to set/extend the PATH of the spawned subprocess. (docs)
The package actually uses this path argument on OSX, but has it hardcoded (I am partly guilty of that as I rewrote the command because it was just horrible before). It should allow for a setting to specify the path to your jshint executable, so I suggest you create an issue for that.
I don't know why ST dosn't pick up your PATH from somewhere else since I have very little experience with that.
Open /etc/profile in Sublime (using sudo) and add the following line at the very bottom:
export PATH=/home/cmg/node_modules/.bin:$PATH
and save the file. Restart completely, and your PATH should be updated.

SublimeREPL + Octave

I am using Octave for some Machine Learning work and I have noticed in my package library in Sublime that there is SublimeREPL: Octave as an option.
However when I select it, I get the following error message:
FileNotFoundError(2, "No such file or directory: octave")
Is there a way to use sublime to code with Octave?
Many thanks
First, you need to find out where your octave executable lives, and note the full path to it. On Linux or OS X, open your favorite terminal emulator and type which octave, and if it's in your $PATH variable it will print the full path to it (for example, /opt/local/bin/octave or something like that). If it's not in your path, or if you're on Windows, you'll have to search around a bit until you find octave or octave.exe, if you're on Windows.
Once you have the path, open Sublime and select Preferences -> Browse Packages..., which will open your Packages folder (surprisingly). Navigate to Packages/SublimeREPL/config/Octave and open the Main.sublime-menu file in Sublime - don't worry, it's just plain JSON. Go down to line 18 (or thereabouts) - it should say "cmd": ["octave", "-i"],. Change "octave" to "/full/path/to/octave", obviously replacing /full/path/to/ with the actual full path you noted earlier.
Save the file, and you should be all set. Tools -> SublimeREPL -> Octave should now open up an interactive session, just like running octave -i on the command line would do. You can use all of the usual SublimeREPL shortcuts to send code to the running REPL, or just use if for testing functions, code snippets, etc.
Have fun!
I am using Sublime Text 3 on OS X
Octave programs are running perfectly. So you can try the below mentioned steps
Open Sublime
Goto Tools --> Build System --> New Build System...
Paste this code
{
"cmd": ["/usr/local/octave/3.8.0/bin/octave-3.8.0", "$file"],
"selector": "source.m"
}
Save it as Octave.sublime-build
Now use Octave as your build system
Use ⌘ + B to run your code.
Enjoy!

Sublime Text 2 and bin paths

If I print my $PATH in a terminal (zsh) I get:
λ echo $PATH
/Users/jviotti/.nvm/v0.11.13/bin:/Users/jviotti/bin/Sencha/Cmd/4.0.2.67:/usr/sbin:/usr/local/bin:/usr/local/sbin:/sbin:/opt/bin:/Users/jviotti/bin:/home/jviotti/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin
However if I print the environment variables from Sublime Text 2 console I only get:
>>> print(os.environ['PATH'])
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jviotti/bin
Sublime Text 2 detects that I'm using Zsh, however most of my paths are missing.
How can I fix this?
When you launch Sublime via the command line with the subl command, it picks up your current PATH from your shell. However, files launched from the GUI have a separate PATH, and this is what needs to be changed. Please check out my answer over at Unix.SE for detailed instructions on how to set the PATH for OS X programs launched via the Dock or Finder. This has only been tested on Mountain Lion (there is a different method for Lion), and while it should work on Mavericks I can't guarantee it. It does require having admin privileges.
Briefly, you need to edit /etc/launchd.conf (or create it if it doesn't exist) to include all the entries you want, then restart your computer for the changes to take effect. Keep in mind that this will affect all GUI programs, not just Sublime, so if you start getting unexplained behavior or errors, this may be the reason.
Good luck!