Heroku does not install toolbelt PATH by default on OSX with bash - heroku

Installing heroku-toolbelt/2.32.9 on OSX 10.7.4 fails to setup the PATH correctly for bash.
To fix this I created a .bash_profile with a correct PATH:
$ cat ~/.bash_profile
export PATH=/usr/local/heroku/bin/:$PATH

I did this instead:
$ touch ~/.bash_profile
export PATH=/usr/local/heroku/bin/:$PATH

Related

How do I add directories to PATH?

Long story made short, I am trying to issue myself an SSL certificate using LetsEncrypt, and have recently installed rbenv to make this process easier. After installing rbenv, I check to see if everything checks out using
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
I than get this message saying that there are no versions of ruby installed. After trying to install ruby using the command
"rbenv install 2.3.1"
I get this error
rbenv: no such command `install'
Is it because the path to my rbenv shims aren't in my PATH variable ? If this is the case how do I add directories to my PATH variable ? I know you have to add them to your bash_profile file, but am not sure where in this file I need to add something, and what I need to add.
~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
function letsencrypt_webfaction {
PATH=$PATH:$GEM_HOME/bin GEM_HOME=$HOME/.letsencrypt_webfaction/gems RUBYLIB=$GEM_HOME/lib ruby2.2 $HOME/.letsencrypt_webfaction/gems/bin/letsencrypt_webfaction $*
}
eval "$(rbenv init -)"
PATH=$PATH:$HOME/bin
export PATH
export PATH="$HOME/.rbenv/bin:$PATH"
Always be careful when editing the profile.
Better make a backup first
switch to home directory:
cd
list hiden files:
ls -la .bash*
make a backup copy of .bash_profile:
cp -p .bash_profile .bash_profile.bak
check the current PATH: echo $PATH
check if ruby is in the PATH: which ruby
check the ruby version: ruby --version
I am not sure where this function is comming from in your .bash_profile: function letsencrypt_webfaction()
Use : as a separator and add a new directory new_dir to your PATH, use $PATH to keep the contents of the actual PATH, then export the new PATH:
PATH=$PATH:/new_dir:/new_lib
export PATH
Verify if the PATH is what you need from the terminal: echo $PATH
Personaly I sugest making a backup of .bash_profile as it is. Comment out with # the 3 lines for the function and the others where the PATH appears and add this:
export RUBYLIB=$HOME/lib
export GEM_HOME=$HOME/gems
export PATH=$HOME/bin:$PATH:
After this please check the bulet points above and see if you have the ruby version you expect.
According to the documentation you should install the ruby-build plugin:
The rbenv install command doesn't ship with rbenv out of the box,
but is provided by the ruby-build project.

oh my zsh's plugin "osx" not work

As the title,my oh my zsh has installed autojump plugin by homebrew,but osx doesn't work,I have open the plugin named osx in the .zshrc file.eg: plugins=(osx zsh-syntax-highlighting git autojump),and the file names ~/.oh-my-zsh/plugins/osx/os.plugin.zsh is correct.
I use the following command feedbacked a error "zsh: command not found: quick-look".
$ quick-look xx.jpg
I don't know why?Could somebody give me some help?Thx.
You could try:
$ qlmanage -p xx.png
quick-look is a function implemented inside the osx plugin that is actually calling the qlmanage command, if the above command works for you, just create an alias in your ~/.zshrc to your convenient, some like this:
Creating the alias:
$ echo "alias 'quick-look=qlmanage -p' >> ~/.zshrc
Load the new changes to your current session:
source ~/.zshrc
Then you should be able to run:
quick-look xx.png

How to place the ~/.composer/vendor/bin directory in your PATH?

I'm on Ubuntu 14.04 and I've been trying all possible methods to install Laravel to no avail. Error messages everything I try. I'm now trying the first method in the quickstart documentation, that is, via Laravel Installer, but it says to "Make sure to place the ~/.composer/vendor/bin directory in your PATH so the Laravel executable is found when you run the Laravel command in your terminal." so my question is, how do I do that? This may be a simple question but I'm really frustrated and would appreciate any help.
To put this folder on the PATH environment variable type
export PATH="$PATH:$HOME/.composer/vendor/bin"
This appends the folder to your existing PATH, however, it is only active for your current terminal session.
If you want it to be automatically set, it depends on the shell you are using. For bash, you can append this line to $HOME/.bashrc using your favorite editor or type the following on the shell
echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bashrc
In order to check if it worked, logout and login again or execute
source ~/.bashrc
on the shell.
PS: For other systems where there is no ~/.bashrc, you can also put this into ~/.bash_profile
PSS: For more recent laravel you need to put $HOME/.config/composer/vendor/bin on the PATH.
PSSS: If you want to put this folder on the path also for other shells or on the GUI, you should append the said export command to ~/.profile (cf. https://help.ubuntu.com/community/EnvironmentVariables).
Detailed instructions:
in your ~/.bashrc add these lines:
export PATH="$PATH:~/.composer/vendor/bin"
Then reload:
source ~/.bashrc
Check if its added correctly:
echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/web/bin:~/.composer/vendor/bin
In Ubuntu 16.04 LTS with composer globally installed, this worked for me.
Edit the .bashrc file in your home directory puting the path to the composer bin folder that is located in /your/home/.config/composer/vendor/bin
echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.bashrc
source ~/.bashrc
If not works, verify the path to the composer bin directory and close and reopen the terminal. Otherwise, try to logoff and login in the Ubuntu.
Also works in ubuntu 18.04. Thanks #chifliiiii for your feedback.
For setting the PATH on Yosemite (OS X 10.10.5), use the command below:
echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bash_profile
To reload either quit terminal and start up again or use:
source ~/.bash_profile
Helped me, hope it helps someone else out there!
I did all of the above and it didn't work for me.
I just copied this into my terminal and it worked for me.
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
my path didn't have /.composer, just /composer so my path was:-
export PATH="$PATH:$HOME/.config/composer/vendor/bin"
This worked for me on ubuntu 20.04
This is for setting PATH on Mac OS X Version 10.9.5.
I have tried to add $HOME because I use user profile :
echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bashrc
When you do not use user profile:
echo 'export PATH="$PATH:~/.composer/vendor/bin"' >> ~/.bashrc
Then reload:
source ~/.bashrc
I hope this help you.
Open the Mac Terminal:
vi ~/.bashrc
If you haven't used vi, it may look a little funny at first, so enter the following code carefully, in order:
i
export PATH="$PATH:$HOME/.composer/vendor/bin"
PRESS ESC
:
w
PRESS ENTER
:
q
PRESS ENTER
Now you should have returned to the normal terminal view.
Check that composer now has the correct path:
cd ~/.composer
echo $PATH
If you see the path including your file directory, (e.g. /Users/JeffStrongman/.composer/vendor/bin), you're good to go.
cd
Then run your installation. I ran into this problem, while configuring my Mac to use Laravel Valet.
Example (optional)
valet install
For Linux Mint 18: edit ~/.bashrc and add this line to it at the bottom:
export PATH="$PATH:$HOME/.config/composer/vendor/bin"
then resource .bashrc (type in console):
source ~/.bashrc (or close and reopen the terminal)
test it by typing in the console:
echo $PATH
or type in console:
laravel
In case someone uses ZSH, all steps are the same, except a few things:
Locate file .zshrc
Add the following line at the bottom export PATH=~/.composer/vendor/bin:$PATH
source ~/.zshrc
Then try valet, if asks for password, then everything is ok.
add environment variable into bashrc file
For Ubuntu 17.04 and 17.10:
echo 'export PATH="~/.config/composer/vendor/bin"' >> ~/.bashrc
For Ubuntu 18.04
echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bashrc
to Check environment variable working or not first reload the bashrc file
source ~/.bashrc
if not working any method then First Check Where is install Composer to Check Run This Command :
locate composer -l 1
then Copy Output add output into this line and run again command.
echo 'export PATH="OUTPUTHERE/vendor/bin"' >> ~/.bashrc
After Successfully Laravel Command Work Give a Permission To Parent Folder (for example u are using apache server than give permission to apache web listing directory like that)
sudo chown $USER:$USER -R /var/www/html/
For me in Ubuntu 22.04, this works:
export PATH="$PATH:$HOME/.config/composer/vendor/bin"
Adding export PATH="$PATH:~/.composer/vendor/bin" to ~/.bashrc works in your case because you only need it when you run the terminal.
For the sake of completeness, appending it to PATH in /etc/environment (sudo gedit /etc/environment and adding ~/.composer/vendor/bin in PATH) will also work even if it is called by other programs because it is system-wide environment variable.
https://help.ubuntu.com/community/EnvironmentVariables
MacOS Sierra User:
make sure you delete MAAP and MAAP Pro from Application folder if you have it installed on your computer
be in root directory cd ~
check homebrew (if you have homebrew installed) OR have PHP up to date
brew install php70
export PATH="$PATH:$HOME/.composer/vendor/bin"
echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bash_profile
source ~/.bash_profile
cat .bash_profile
make sure this is showing :
export PATH="$PATH:$HOME/.composer/vendor/bin"
laravel
now it should be global
The Composer bin directory is set and stored in bin-dir config variable and can be different depending on your setup. Running the command composer global config bin-dir --absolute will tell you the absolute path to your global composer bin directory. Using this command you can modify your .bash_profile to add it to your PATH exactly how it is configured.
# Add Composer bin-dir to PATH if it is installed.
command -v composer >/dev/null 2>&1 && {
COMPOSER_BIN_DIR=$(composer global config bin-dir --absolute 2> /dev/null)
PATH="$PATH:$COMPOSER_BIN_DIR";
}
export PATH
AWS Ubuntu 18.04 LTS
Linux ws1 4.15.0-1023-aws #23-Ubuntu SMP Mon Sep 24 16:31:06 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.bashrc && source ~/.bashrc
Worked for me.
On Fedora:
Some composer bins are not in the .composer directory
So you need to locate them using:
locate composer | grep vendor/bin
Then echo the the part into the .bashrc
echo 'export PATH="$PATH:$HOME/{you_composer_vendor_path}"' >> ~/.bashrc
Mine was "/.config/composer/vendor/bin"
Cheers!
For Ubuntu 16.04
echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.bashrc
source ~/.bashrc
I did this and it works on osx:
lunch your terminal
nano ~/.bash_profile
And paste
export PATH=~/.composer/vendor/bin:$PATH
press control + x
press the y key
press the return / enter key
this is what I added in my .bashrc file and worked.
export PATH="$PATH:/home/myUsername/.composer/vendor/bin"
To solve this problem make sure you find the path of composer.phar first
example mine is something like this
alias composer="php /Users/Your-username/composer.phar"
Go to cd Users > Your user > Command ls and see if composer.phar is there if yes then add the above line to your .bash_profile. Make sure you change the username to your own.
Hope this help you out
I've tried a lot of solutions, but on Ubuntu 20.04 only this worked for me:
export PATH="$HOME/.composer/vendor/bin:$PATH"

add command to path in OSX Mavericks

I'm trying to add a variable to my path in my OSX Mavericks using ~/.bash_profile, but when I type it, I get this error:
-bash: /Users/MyUser/.bash_profile: No such file or directory
I've read somewhere that in Mavericks it's done in a different way.
Anyone knows how to do this?
I am using ._bash_profile and .bashrc on Maverick, this work well.
If it does not exist, you can create and edit it using, vim, emacs or any editor.
$ touch ~/.bash_profile
$ open ~/.bash_profile -a "TextEdit"
This is my .bash_profile, the second line (export PATH) is what you are looking for.
# Set architecture flags
export ARCHFLAGS="-arch x86_64"
# Ensure user-installed binaries take precedence
export PATH=/usr/local/bin:$PATH
# Load .bashrc if it exists
test -f ~/.bashrc && source ~/.bashrc
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
See, it works ! Ahahah goo.gl/eDBVD0

etc/paths modifications not taken into account in OS X Mountain Lion

I installed node.js, pip, rvm a few weeks ago. I just installed them and checked everything was working fine.
Yesterday, as I tried to install howdoi (https://github.com/gleitz/howdoi) using zsh via pip, I got a pip : command not found error message.
The echo $PATH command gave me this:
"rvm stuffs":/usr/bin:/bin:/usr/sbin:/sbin:
Then, I checked the etc/paths file:
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
It looks like /usr/local/bin is in my etc/paths file but not in my path.
I temporarily fixed this with a temporary solution:
export PATH=$PATH:/etc/paths
This morning, I am looking for a permanent solution.
You could add this to your ~/.profile, ~/.bashrc, or ~/.bash_profile. In Terminal:
cat << EOF >> ~/.profile
PATH=/usr/local/bin:\$PATH; export PATH
EOF
Open a new Terminal (Command + N) and test the change:
echo $PATH

Resources