0

The documentation of packer says: Packer Setup Documentation

on how to set the PATH : How to permanently set PATH in Unix

And I did add :

export PATH=$PATH:~/packer/ 

in my ~/.zshrc file

however, when I go to type packer on the terminal first time, the dir changes to be ~/packer and when I type packer again I get :

~  packer
➜  packer  packer
zsh: command not found: packer

Does anyone have a better clue on how to set up packer's PATH on a Macintosh Unix system?

Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
David
  • 1,469
  • 5
  • 33
  • 51

3 Answers3

1

In OS X you would typically have any exports set in:

~/.bash_profile

If you already have a .bash_profile setup then it will override .profile. Since you're using zsh you might try putting the export in ~/.zprofile.

l'L'l
  • 44,951
  • 10
  • 95
  • 146
  • on echo $PATH, I get, /Users/user123/.rbenv/shims:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/user123/packer/ – David Mar 22 '16 at 02:07
  • @Becks: I think you need to get rid of the last thing in your `$PATH` (/Users/User123/packer). If `packer` is installed in `/usr/local/bin` then that should be all you need. Try running the command `which packer` and see what is output. – l'L'l Mar 22 '16 at 02:12
  • @I'L'I here: cd ~/ ➜ ~ pwd /Users/user123 ➜ ~ echo $PATH /Users/user123/.rbenv/shims:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin ➜ ~ cd packer ➜ packer which packer packer not found ➜ packer – David Mar 22 '16 at 04:22
  • @Becks: The command is `which packer` all by itself. Where did you install it, that's the question. – l'L'l Mar 22 '16 at 06:41
0

Please try adding your edits to the ~/.profile file instead of ~/.bashrc file.

Aparna Chaganti
  • 599
  • 2
  • 5
  • 15
  • I don't have a profile file. I have zsh installed, hence I tried adding my edits in ~/.zshrc but that doesn't seem to work either :( ... I do ➜$ which zsh and I get /bin/zsh – David Mar 22 '16 at 01:36
0

To make the new path stick permanently you need to create a .bash_profile file in your home directory and set the path there.

  1. Open terminal on Mac and write nano .bash_profile.
  2. Create the .bash_profile file with a command line editor called nano,If it is already exists then it will open a text editor containing path.
  3. Add the path you require like:

    export PATH="/usr/local/node/bin:$PATH"
    
  4. Save the file in nano by clicking Ctrl+O and confirming the name of the file as .bash_profile by hitting enter. And the Ctrl+X to exit nano.

  5. Then for checking path is set or not just write echo $PATH in terminal. Your path would be there in it.

Lizzy
  • 2,033
  • 3
  • 20
  • 33
udit naik
  • 1
  • 1