Stardog Command not found - macos

I am trying to get to install stardog on mac 10.8.5 using the instructions provided at http://docs.stardog.com/quick-start/.
The export path particular directory has been created and for which echo’ed to make sure that environmental variable is set up. The license key that is provided is also in the correct directory. When I try to run “$ ./stardog-admin server start” the command is not recognized. So I tried to create an export PATH to stardog’s bin, which did not work either.
I have also tried manually adding the path in the following:
- ~/.bash_profile
- ~/.profile
Still no luck, any ideas?

Using zsh I had a similar problem. For some reason, the docs suggest that from the stardog-directory-name directory you can run the command, but it didn't work until you cd into the bin directory. Once there ./stardog-admin server start should run correctly.

It sounds like you simply have something incorrect in your .bash_profile or .profile. If you run either of the stardog scripts from it's bin directory, it will work. If you're getting a command not recognized error, that sounds like bash cannot find the stardog-admin script.

Related

Mac OS terminal doesn't find commands

I have weird problem as all of the sudden terminal stopped reading any commands. Last weekend I installed Wordpress with PHP and mySQL and since that moment didn't have time to do anything more on laptop. Now I wanted to launch some react-native code but command wasn't found, then I tried different things to use some other commands and each time I get message
MBP-Mateusz-2:business-cards-native mateusz$ code .
-bash: code: command not found
and doesn't matter what command is that except standard ones like ls, cd etc. However when I try to write npm --version, or node --version, or launch visual studio code like before with code ., each time I get command not found. Doesn't anyone have issue like that? How to fix it as I'm super confused and have no idea even where to start.
You probably messed up your PATH environment variable, and now your computer cannot find the commands if you don't tell it directly where. The PATH variable contains the directories where the system should look for binaries if they're not in the current directory. If it gets corrupted for some reason, you won't be able to run any program from the terminal unless you pointed directly its location.
I would first run this command:
echo $PATH
so you can see which is the content of the PATH.
If it seems empty, or some critical folders are missing, try to add them temporarily:
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
Then try to run the commands again from the same terminal and see if that worked.
If that works, check if you have a ~/Library/LaunchAgents/environment.plist file and its content. It is possible that there is a key for the PATH and that its values are pointing something of your Wordpress stack but not the system directories.
If that looks fine, look at the ~/.bash_profile file. Find any export PATH instruction that may explain your issues. If you can't find any, but still exporting the PATH worked out, add at the end of the file that instruction as a workaround for fixing the mess:
export PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
(notice that I'm ading $PATH in this last case so if there is any other path actually configured it is added as well)
Good luck.
EDIT: That's the usual issue people has, but now that I've read your comments, the issue seems a bit more serious. It looks like the mySQL setup destroyed your /usr/local/ folder, which means you lost all the binaries located there npm, code, etc.
If you have a backup of the whole filesystem (which by experience is unlikely), restore /usr/local folder.
If you don't have any backups, you can reconstruct /usr/local... by reinstalling the software that cannot be found. Reinstall npm, VSCode, etc, that will place their executables again in the /usr/local folders and from there you'll be good to go. Install brew (since it's likely that also got deleted) then try brew install node and see if now you can run npm. If that works out, I'm afraid you'll have to reinstall all the software you lost again.

Installing Glassfish, Wildfly using homebrew on Mac OSX

Trying to install Glassfish(Java EE App. Server) and Wildfly App Server using Homebrew .
http://macappstore.org/wildfly-as/
http://macappstore.org/glassfish/
used these above mentioned tutorials .
I got the following errors while trying to run them by typing just "glassfish" & "wildfly-as" respectively.
Output(Error):
-bash: glassfish: command not found
-bash: wildfly-as: command not found
Searched about it and I think it has something to do with $PATH. I don't understand $PATH Variable . Need help.
The issue is that there are two asadmin scripts. One at $GLASSFISH_HOME/bin and one at $GLASSFISH_HOME/glassfish/bin
Here are full instructions to get your domain up
brew update
brew install glassfish
you should see message, add that line to your .bash_profile
==> Caveats
You may want to add the following to your .bash_profile:
export GLASSFISH_HOME=/usr/local/opt/glassfish/libexec
Open a new terminal then, cd $GLASSFISH_HOME/glassfish/bin
./asadmin start-domain --verbose
Browse to http://localhost:8080 for welcome page and http://localhost:4848 for admin console
I actually installed Wildfly-Application Server using homebrew but could not find a way to run it.
https://tomylab.wordpress.com/2016/07/03/how-to-install-wildfly-on-mac/
This tutorial helped me .
And for glassfish, my installation was again successful using homebrew but was not able to run it . I did figure it out when I ran the following commands.
$ cd /usr/local/opt/glassfish/libexec/bin
$ ./asadmin
asadmin> start-domain
You need to understand about the PATH variable. It is an environment variable on Unix-like operating systems, specifying a set of directories in which executable programs are located. In general, each executing process, or user session, has its own PATH setting.
So, you need to add the glassfish home path to your actual path variable.
Now, as per your problem with running the Glassfish server; try this:
export GLASSFISH_HOME=/usr/local/opt/glassfish/libexec/
export PATH=$PATH:$GLASSFISH_HOME/bin
Add it to your bash profile, if you do not want to do this everytime.

Installing Heroku Toolbelt on Windows 10

I've been having some issues installing the Heroku toolbelt on Windows 10, 64-bit.
It's the first time I install Heroku. I downloaded it from https://toolbelt.heroku.com/windows.
After installing, I tried launching a new Git Bash and typing heroku login but what I got back was bash: heroku: command not found
Running the same command on Windows Powershell, what I got back was
'MYSQL' is not recognized as an internal or external command,
operable program or batch file.
'MYSQL' is not recognized as an internal or external command,
operable program or batch file.
Any suggestions? I thought that googling those lines would help, but I haven't found much.
I followed the recommendation from here, but now when typing heroku login on the Powershell, nothing happens. Nothing changes on the Git Bash.
I checked, and the Heroku folder was added to the PATH.
I thought I'd ask for some help before installing anything else.
Thank you!
bash: heroku: command not found
The error message is clear: Bash cannot find the heroku command, it's not on your PATH.
I checked, and the Heroku folder was added to the PATH.
It seems you didn't check it correctly.
Note that even if it looks correct in the PATH settings window,
Git Bash might have a different PATH configured.
To see the PATH in Git Bash, run:
echo $PATH
When debugging path issues,
it's best to first run heroku with the absolute path. For example if it's in C:\Program Files\Heroku\bin\heroku then you can run in Git Bash with:
/c/Program\ Files/Heroku/bin/heroku login
If this works (and it should),
then you can add it to PATH like this:
PATH="$PATH:/c/Program\ Files/Heroku/bin"
Note that Heroku will likely need other programs too on the PATH,
such as MySQL and Ruby.
Find their absolute paths,
and add there directories to PATH the same way as heroku itself in the above example.
If instead of Git Bash,
you want to work in CMD,
the procedure is the same,
but the syntax to print and set PATH is different:
echo %PATH%
set PATH="C:\Program Files\Heroku\bin;%PATH%"
In windows bash instead of this
PATH="$PATH:/c/Program\ Files/Heroku/bin"
use this
PATH="$PATH:/c/Program Files/Heroku/bin"
My working solution (for git-bash especially) is:
alias heroku='winpty `where heroku.cmd`'
stored in .bashrc in home user dir
and them
heroku
works as expected
If using bash from VSCode, I had to restart VSCode, after installing heroku. If not using VSCode, you probably need to restart your bash terminal, after installing heroku.
In Control Panel\All Control Panel Items\System (if you are using Windows), go to Advanced system settings, and there in Environment Variables, you'll find two lists, on the same window, viz. System variables, and User variables for your system. Make sure you add your path, viz. C:/Program Files/Heroku/bin, in both of these lists.
I know this is an old thread and just want to share my solution.
Edit .bashrc for git-bash
alias heroku='"C:\Program Files\Heroku\bin\heroku.cmd" $#'

jenkins on Mac, PATH is not set right, no /usr/local/bin

I recently installed Jenkins, using Homebrew. I also installed Mercurial using Homebrew.
I can successfully clone an hg repo just fine - from Terminal. But if I try and do the same thing as part of a job in Jenkins, it fails.
So, in by job, I told Jenkins to run a shell script echo $PATH. Sure enough, the path /usr/local/bin is not there. If I execute the same command from Terminal, it's there.
So, what is the best way to modify PATH so that Jenkins is pulling the same PATH that I'm using, when I echo it from Terminal?
Note, Jenkins is running from the same user account that I'm logged into doing these tests, so I can't fathom why this is happening.
In your launchd .plist file for Jenkins, you can set the PATH environment variable by using the following:
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>(insert your path value here)</string>
</dict>
That should set the PATH to whatever you need.
For some reason, Jenkins doesn't keep /usr/local/bin in the PATH when connecting to a slave.
You can add it to the PATH either by
Adding an environment variable on the Node Configuration, or
Adding a .bashrc file on the user folder with
PATH="/usr/local/bin:${PATH}"
Note: The Mac client must be disconnected and then reconnected via the Jenkins web app after editing ~/.bashrc
I found that even setting the PATH environment variable for the node didn't work for the hombrew Mercurial installation. The path WOULD get set, but only for the script build phase, not for the VCS checkout phase. Here's what I wound up doing.
Go into Manage Jenkins -> Configure System
Add a new Mercurial Installation
Name it whatever you want (I named mine build-mac)
For Installation Directory I put /usr/local
The Executable parameter was pre-set to INSTALLATION/bin/hg, so I just left it at that.
Everything else in here can be left blank
Go into your job and edit the configuration
Under Source Code Management set Mercurial Version to the mercurial installation you just added.
Save
$$$
Hope that helps anyone else running into this same problem, now that we're not allowed (by default anyways) to do anything inside of /usr/bin anymore. Previously I would have just symlinked hg there, but now with the new "System Integrity Protection" "feature", that's no longer as trivial of task, and even more difficult if your Mac slave is headless.
You can set PATH in launchd.conf file. See here for details. Note that man launchctl says that 'commands can be stored in $HOME/.launchd.conf or /etc/launchd.conf to be read at the time launchd starts', so you probably can create '.launchd.conf' in your home directory and use instructions from the link with this file. But as far as I know in launchd.conf file you can't add directory to PATH, you can just rewrite PATH.
You can also see here for the solution using /etc/paths.d directory
There should be no space on either side of = in following PATH modification:
PATH="/usr/local/bin:$PATH"
I added it to my pre-build step on Jenkins installed on macOS.

Sudo Won't Work after change/mistake in Path env

I'm a Mac newbie and just upgraded to Node.js 0.67. After running node, the installer says "Make sure that /usr/local/bin is in your $PATH."
And I try to run node but as expected, it doesn't run without the path change.
So not really knowing what I'm doing (yes!), after some research I do this:
export "PATH=/usr/local/bin"
And node runs. But sudo doesn't. Which I think means I screwed up the environment variables.
sudo: command not found
Then in another Terminal window (that was open when I messed this up), sudo does respond; both windows have the same path. But in that window, npm is no longer available.
Can anyone help get me back to sudo stability?
sudo on a Macintosh lives in /usr/bin.
Make sure /usr/bin is in your $PATH environment and you should be okay.
And to do that, in the context of your question above, do something like:
export "PATH=$PATH:/usr/local/bin"
The idea here being that you are appending a new search path to the already existing list in your PATH environment variable.
Here is a potentially useful tutorial you can refer to.

Resources