Enterprise Framework

Software Solutions in the Enterprise

Mac - Brew Install Python - fails with Error: No such file or directory @ dir_chdir - /usr/local/Cellar

Installing python using brew install fails.

$ brew install python

==> Installing dependencies for python: gdbm, openssl, readline, sqlite and xz

==> Installing python dependency: gdbm

==> Downloading https://homebrew.bintray.com/bottles/gdbm-1.18.1.high_sierra.bottle.tar.gz

Already downloaded: /Users/ramiscaray/Library/Caches/Homebrew/downloads/74ba9ab51669f49dc4dc585e1683648d26858c444e775c8f8b819932df55cf14--gdbm-1.18.1.high_sierra.bottle.tar.gz

Error: No such file or directory @ dir_chdir - /usr/local/Cellar

Warning: Bottle installation failed: building from source.

==> Downloading https://ftp.gnu.org/gnu/gdbm/gdbm-1.18.1.tar.gz

Already downloaded: /Users/ramiscaray/Library/Caches/Homebrew/downloads/c6e5196e3cea2a139cb849d508032f117c6351da5fe84323dc13ad2a0600264a--gdbm-1.18.1.tar.gz

Error: An exception occurred within a child process:

  Errno::EPERM: Operation not permitted @ dir_s_mkdir - /usr/local/Cellar

Trying "brew update", "brew doctor" didn't resolve anything.

Solution:

Reinstall homebrew 

Go to https://brew.sh/

Open terminal and rerun homebrew install

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Retry python homebrew install

$ brew install python

Mac Mongodb Installation


Download MongoDB community server

https://www.mongodb.com/download-center/community


Unzip the file in downloads

mongodb-osx-ssl-x86_64-4.0.4.tgz  => mongodb-osx-ssl-x86_64-4.0.4


Copy the file to the bin directory.  Open Terminal

cd mongodb-osx-ssl-x86_64-4.0.4
cd bin
mkdir /usr/local/bin/mongodb
cp * /usr/local/bin/mongodb
sudo mkdir -p /data/db
sudo chmod 777 /data
sudo chmod 777 /data/db


Add the MondgoDB file path to .bash_profile

$ nano ~/.bash_profile


Add the following line to .bash_profile and save:

   export PATH=/usr/local/bin/mongodb:$PATH
You'll probably need to restart the terminal session for path to be applied.


Start MongoDB by typeing mongod (d is for daemon)

$ mongod


Open a new terminal window and switch to the directory, type mongo

$ mongo


Insert a test record

> db.users.insert({"fullname": "robert amiscaray"})


Install Python 3 by doing brew install python.  Note:  PIP3 will also be installed.

$ brew install python


Install httpie for http helpers

$ sudo -H pip3 install httpie