Adding spark-installer to path with zsh - laravel

I'm using zsh with oh-my-zsh as my shell and I need to add the Laravel Spark Installer to my path, but I must be missing a step or messing up the syntax
I've added spark-installer to my path like this:
path+=('/Users/retrograde/Development/spark-installer')
Nothing was added to the path, so I edited it directly with:
vim ~/.zshrc
added
# Spark installer
export PATH="$HOME/Users/retrograde/Development/spark-installer:$PATH"
then ran:
source ~/.zshrc
The spark-installer does not show with the other paths upon running echo "$PATH"
Am I missing something? Maybe my syntax is wrong? TIA

Related

zsh: command not found: mv (I'm trying to move composer.phar)

I'm trying to follow a course on Udemy (laravel). I just downloaded XAMPP (I'm on macOS Monterey) and I edited the ~/.zshrc file and added export PATH=/Applications/XAMPP/bin
After that I installed composer which worked successfully, but now when I try to run this command: mv composer.phar /usr/local/bin/composer the shell responds with: zsh: command not found: mv.
Does anyone know how to fix this?
You messed up your PATH. Do a
path+=(/Applications/XAMPP/bin)
instead of the export PATH=... you are using now. And since you want to fiddle with the PATH in your .zshrc, I also suggest to do a
typeset -aU path
near the top of your .zshrc to avoid duplicate PATH entries when you launch an interactive subshell.
The file mv was not found in your PATH, is your PATH variable setup correctly?
Enter echo $PATH to see your PATH variable.
Try /bin/mv to see if the binary file exists.

Why is my .bashrc and .bash_profile different from echo $path

i was trying to add something to my path. But since i'm nog very familiar with the terminal i think i messed something up.
when i do echo $PATH i get:
/Users/christoph/.node/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
but when i open .bashrc i see this:
alias homestead=~/.composer/vendor/bin/homestead
echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bashrc
export PATH="$PATH:$HOME/.composer/vendor/bin"
And when i open .bash_profile i see this:
export PATH="$HOME/.node/bin:$PATH"
I want to do this step : (to install laravel valet)
Install Valet with Composer via composer global require laravel/valet.
Make sure the ~/.composer/vendor/bin directory is in your system's
"PATH".
And i am very confused on how i should add this path. Also in which file do i need to put it?
I am using MAC OSX El Capitan
Remove this line from your .bashrc!!!
echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bashrc
It appends a new line to your bashrc each time you log in.
Overall you should modify your PATH env variable only in single file (.bash_profile, but many people will make an error of modifying .bashrc). It works like this: PATH is list of directories splitted by ':' character, $PATH expands to previous value of this list. Example:
export PATH=/fooo:/barr:/bazzz
Places exactly these tree directories in PATH variable. In your case you should have following line in your .bash_profile:
export PATH=$PATH:$HOME/.node/bin:$HOME/.composer/vendor/bin
And remove all unnecessary aliases.

"reload ~/.bash_profile"error by installing virtualenvwrapper

The virtualenvwrapper official documents ask me to add three lines to ~/.bash_profile, but I add three wrong lines to there, and then, there is an error looks like below after I reloaded by commandsource ~/.bash_profile
/Users/donald/.bash_profile:1: bad assignment
Can anyone tell me how to do and why? and if someone can teach me how to install virtualenvwrapper? I have spent a whole night working on this and fail.
The three wrong command lines are:
export WORKON_HOME=~/Envs
mkdir -p $WORKON_HOME
source /usr/local/bin/virtualenvwrapper.sh
It's just a simple question, I found the answer later.
After you add wrong command lines to .bash_profile , you can use the command lines below to get a easy-editing window
touch ~/.bash_profile
open -e ~/.bash_profile
then you will know how to do.
And...
If you are confused with installing virtualenvwrapper, have a look on this:
virtualenvwrapper.sh is not in /usr/local/bin, you can use the command line below to find where is it.
which virtualenvwrapper.sh
After that, you can copy the virtualenvwrapper.sh to /usr/local/bin or change the path after source command in the .bash_profile.
Remember to reload the .bash_profile with the command line below everytime you use virtualenvwrapper.
source ~/.bash_profile
Thanks~!

PredictionIO: Pio command not found after install

I am guessing that somehow PredictionIO didn't setup the path variables properly.
I used method 2 to install PredictionIO from this link here: PredictionIO
Everything installed correctly but when I typed in pio it says command not found. This is what I see:
When I try to start pio from finder I get this:
Kind of lost, what am I doing wrong here?
The solution is to edit your PATH environment variable. You can do it directly in the shell:
$ export PATH=/Users/yourname/PredictionIO/bin:$PATH
However it will be set only as long as the session lasts. To make it permanent, you have to edit your bash profile file. I don't know how it is called on MacOS. On my Ubuntu, it is the .profile file. It is usually .profile, or .bash_profile or something like that.
$PATH is probably set in this file, so find where and edit.
My .profile file has a part in it that reads:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:/opt/java/jdk1.8.0_45/bin:$PATH"
fi
I would change it to (even though it looks weird because it mixes your MacOS path and my Ubuntu ones):
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:/opt/java/jdk1.8.0_45/bin:/Users/yourname/PredictionIO/bin:$PATH"
fi
To get this working I simply did the following, this is for Mac Yosemite users.
$ PATH=$PATH:/Users/yourname/PredictionIO/bin; export PATH
Assuming you installed PredictionIO in that specific directory
Sidenote: I really don't like that there is so much cynicism to beginner's / semi-beginner's in certain areas it really makes me question StackOverFlow.
pio uses its own python version, using your system's python can cause problems, you can define an alias in .zshrc file
alias pio='~/.platformio/penv/bin/python3 ~/.platformio/penv/bin/pio'

MacOS source ~/.bash_profile disabled everything

So I was trying to setup the Go programming environment on my Mac and add the necessary directory to the path by modifying the .bash_profile accordingly. After saving the .bash_profile, I tried running "go version" for example but it still didn't work.
After a bit of searching I found that if i did the following:
source ~/.bash_profile
The go version would work. Which it does but it seems that my PATH has been changed since commands such as: nano, vi, ls, sudo etc do not work anymore.
Is there a way of recuperating my initial environment PATH?
Thanks in advance!!
:D
PS - let me know if my issue is not clear
Note that your path is likely just "broken" for your current shell session: Mac OS X doesn't strictly use .bash_profile for your PATH.
My guess is that you didn't write out export PATH=$PATH:$GOPATH/bin and export GOPATH=/Users/sSmacKk/go/ (or wherever you wanted to set it) correctly: if you forget to assign the existing path back to your new path, you'll have problems.
Run path_helper from /usr/libexec/path_helper (which would normally be on your path!)
Add the lines: export GOPATH=/wherever/you/want/ and then export PATH=$PATH:$GOPATH/bin to your .bash_profile
Save and exit from your text editor and then source .bash_profile.

Resources