Closed w3ntao closed 8 years ago
This appears to be a bug in your installation of Debian. See for example http://ubuntuforums.org/showthread.php?t=2258760 Please report:
which -a which git-remote-https
ldd `which git-remote-https`
ldd /usr/lib/x86_64-linux-gnu/libhogweed.so.2
Yep, something wrong with my git. After fixing the bug:
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/linuxbrew/go/install)"
==> This script will install:
/home/rahn/.linuxbrew/bin/brew
/home/rahn/.linuxbrew/Library/...
/home/rahn/.linuxbrew/share/man/man1/brew.1
Press RETURN to continue or any other key to abort
==> Downloading and installing Homebrew...
remote: Counting objects: 353111, done.
remote: Total 353111 (delta 1), reused 1 (delta 1), pack-reused 353109
Receiving objects: 100% (353111/353111), 68.22 MiB | 330.00 KiB/s, done.
Resolving deltas: 100% (267095/267095), done.
From https://github.com/Homebrew/linuxbrew
* [new branch] master -> origin/master
HEAD is now at dc1c2b5 JavaRequirement: Linuxbrew default_formula "jdk"
Warning: /home/rahn/.linuxbrew/bin is not in your PATH.
==> Installation successful!
==> Next steps
Install the Linuxbrew dependencies:
Debian, Ubuntu, etc.:
`sudo apt-get install build-essential`
Fedora, Red Hat, CentOS, etc.:
`sudo yum groupinstall 'Development Tools'`
See http://brew.sh/linuxbrew/#dependencies for more information.
Run `brew doctor` before you install anything
Run `brew help` to get started
$ apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
$ brew
bash: brew: command not found
How do I do for this?
Looks like you need /home/rahn/.linuxbrew/bin/
in your path. Can you add it in and try again?
If it's already in your path, you can try either hash -r
(Bash) or rehash
(Zsh) and then try to run the command again.
I get zsh: command not found: brew
even I'm at directory /home/rahn/.linuxbrew/bin/
I don't know why.
I'm new to Linux, still google on path editing.
@tseemann pointed out that this warning gets buried.
Warning: /home/rahn/.linuxbrew/bin is not in your PATH.
It needs to be improved with these instructions: http://linuxbrew.sh/#installation
Add to your
.bashrc
or.zshrc
:export PATH="$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH"
I append export PATH="$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH"
to the end of ~/.bashrc
and terminal prompt:
\ (gedit:2990): WARNING **: Set document metadata failed: Setting attribute metadata::gedit-spell-language not supported
\ (gedit:2990): WARNING **: Set document metadata failed: Setting attribute metadata::gedit-encoding not supported
After saving:
$ which brew
brew not found
Open a new terminal window with a new shell. It should work.
No, it doesn't...
The line has been appended to ~/.bashrc
But $PATH remain unchanged.
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Try instead appending the line to ~/.bash_profile
Also try running in the new terminal:
PATH="$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH"
which brew
brew env
I don't have a .bash_profile
in ~
so gedit
create a new one for me.
Still:
`$ which brew~
brew not found
Please try:
PATH="$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH"
which brew
brew doctor
It works this time but not after starting a new terminal.
So there is something wrong with .bashrc
?
Found it, It's about zsh
.
I edit .zshrc
and everything goes.
I thought zsh
would inherit config from bash
Thanks, @sjackman @rwhogg
@sjackman @rwhogg We should probably check $SHELL
to tell people which dotfile to add the PATH
stuff to ?
@tseemann @sjackman @rwhogg I think you should.
echo 'PATH="$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH"' >> ~/.$(basename $SHELL)rc
$SHELL -c 'brew doctor'
?
@sjackman pretty much, maybe $HOME/.$(basename ${SHELL:-bash})rc
for safety in case $SHELL
was undefined... is ~
guaranteed to work in all shells?
Yep, ~
expands to $HOME
on pretty much ever shell that I know of. Only at the start of a word though, not in the middle, so the above $HOME
can't be replaced by ~
.
❯❯❯ echo ~
/Users/sjackman
❯❯❯ echo PATH=~
PATH=~
Dependencies installed.
Debian 8.4 on Parallels Desktop 11 of MacBook Pro (Retina, late 2013)