# Brew not installed on some containers

**URL:** <https://discuss.circleci.com/t/brew-not-installed-on-some-containers/7483>\
**Category:** Build Environment\
**Tags:** brew, homebrew\
**Created:** [October 18, 2016, 3:54pm UTC](https://discuss.circleci.com/t/brew-not-installed-on-some-containers/7483 "2016-10-18T15:54:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mfc83](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@mfc83](https://discuss.circleci.com/u/mfc83)\
**Post date:** [October 18, 2016, 3:54pm UTC](https://discuss.circleci.com/t/brew-not-installed-on-some-containers/7483/1 "2016-10-18T15:54:51Z")

</div>

Hi, we’ve seen a lot of builds fail with:

```auto
bash: line 1: brew: command not found

```

Most of the time it works, but it looks like there are some containers that don’t have the correct environment setup on them.

Anything we can do about this?

---

<div class="post-metadata">

**Author:** ![akingabramson](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/akingabramson/32/14482_2.png) [@akingabramson](https://discuss.circleci.com/u/akingabramson)\
**Post date:** [October 26, 2016, 8:44pm UTC](https://discuss.circleci.com/t/brew-not-installed-on-some-containers/7483/2 "2016-10-26T20:44:15Z")

</div>

Having the same issues here. We have a pretty standard circle.yml file:

test:  
pre:  
- brew install geckodriver  
deployment:  
staging:  
branch: staging  
commands:  
- “[[! -s “$(git rev-parse --git-dir)/shallow”]] || git fetch --unshallow”  
- git push OUR REPO $CIRCLE\_SHA1:refs/heads/master --force  
- heroku run rake db:migrate --app PRODUCTION\_APP

uname -a gives me: Linux box1283.localdomain 3.13.0-91-generic #138-Ubuntu SMP Fri Jun 24 17:00:34 UTC 2016 x86\_64 x86\_64 x86\_64 GNU/Linux

---

<div class="post-metadata">

**Author:** ![akingabramson](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/akingabramson/32/14482_2.png) [@akingabramson](https://discuss.circleci.com/u/akingabramson)\
**Post date:** [October 26, 2016, 10:25pm UTC](https://discuss.circleci.com/t/brew-not-installed-on-some-containers/7483/3 "2016-10-26T22:25:22Z")

</div>

I managed to manually install homebrew and reference it by sticking all the brew-related logic on the same line in circle.yml. See below.

```auto
    dependencies:
      pre:
        - ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" </dev/null && PATH="$HOME/.linuxbrew/bin:$PATH" && brew install {your_dependency}

```

---

<div class="post-metadata">

**Author:** ![mfc83](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@mfc83](https://discuss.circleci.com/u/mfc83)\
**Post date:** [October 27, 2016, 9:55am UTC](https://discuss.circleci.com/t/brew-not-installed-on-some-containers/7483/4 "2016-10-27T09:55:18Z")

</div>

We submitted a support ticket and the response was that some containers made it out of staging without brew installed. The problem went away after that.

I’d recommend submitting a ticket if you still see this, so they can fix the containers.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:38am UTC](https://discuss.circleci.com/t/brew-not-installed-on-some-containers/7483/5 "2018-06-18T11:38:48Z")

</div>

Closed on June 18, 2018, 11:38am UTC


