13
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Homebrew をインストールしたはずなのにbash: brew: command not foundになる。

Posted at

###環境
aws: cloud9
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
Rails 6.0.2.1

##install時のwarning
install時にWarning: /home/linuxbrew/.linuxbrew/bin is not in your PATH.)パスがないと怒られました。
brewコマンドを叩いてみても、 「-bash: brew: コマンドが見つかりません」となります。

loning into '/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Enumerating objects: 387, done.
remote: Counting objects: 100% (387/387), done.
remote: Compressing objects: 100% (210/210), done.
remote: Total 895969 (delta 244), reused 283 (delta 177), pack-reused 895582
Receiving objects: 100% (895969/895969), 323.15 MiB | 25.72 MiB/s, done.
Resolving deltas: 100% (614005/614005), done.
Tapped 2 commands and 5124 formulae (5,397 files, 356.7MB).
Already up-to-date.
Warning: /home/linuxbrew/.linuxbrew/bin is not in your PATH.======問題の部分=====
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics data has been sent yet (or will be during this `install` run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations

==> Next steps:
- Run `brew help` to get started
- Further documentation: 
    https://docs.brew.sh
- Install the Homebrew dependencies if you have sudo access:
  Debian, Ubuntu, etc.
    sudo apt-get install build-essential
  Fedora, Red Hat, CentOS, etc.
    sudo yum groupinstall 'Development Tools'
  See https://docs.brew.sh/linux for more information.
- Configure Homebrew in your /home/ec2-user/.bash_profile by running
    echo 'eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)' >> /home/ec2-user/.bash_profile
- Add Homebrew to your PATH
    eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
- We recommend that you install GCC by running:
    brew install gcc

そこで下記のコマンドを実行することで使えるようになります。

echo 'export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"' >>  ~/.bashrc
source ~/.bashrc
13
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?