Am I really using my brews? [Homebrew]

 
Thread Tools Search this Thread
Operating Systems OS X (Apple) Am I really using my brews? [Homebrew]
# 1  
Old 06-25-2011
Am I really using my brews? [Homebrew]

I am a little confused here. I have git installed via homebrew but I'm not 100% sure if the git I am using
in the terminal is the git I have installed via homebrew. In fact this goes for all packages which I have installed via homebrew.

Looking at the below sequence of commands, do I need to add anything extra to $PATH? For instance, should I be adding my brew cellar?
Code:
mbp:~ m$ brew --prefix
/usr/local
mbp:~ m$ brew --cellar
/usr/local/Cellar
mbp:~ m$ ls /usr/local/Cellar/
git        ossp-uuid  postgresql readline
mbp:~ m$ which git
/usr/local/bin/git         ...is this really the git which brew installed?
mbp:~ m$ which oosp-uuid    ...and why can't which find this if git has this installed?
mbp:~ m$ which postgresql   ...this too?
mbp:~ m$ which readline      ... and this too?
mbp:~ m$ echo $PATH
/Users/m/.rvm/gems/ruby-1.9.2-p180/bin:/Users/m/.rvm/gems/ruby-1.9.2-p180@global/bin:/Users/m/.rvm/rubies/ruby-1.9.2-p180/bin:/Users/m/.rvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

thanks Michelle

---------- Post updated at 10:28 ---------- Previous update was at 10:24 ----------

...hold on from the below code it is evident that the git I am using is definitely the one I installed from homebrew:-
Code:
mbp:~ m$ which git
/usr/local/bin/git
mbp:~ m$ brew list
git        ossp-uuid    postgresql    readline
mbp:~ m$ brew uninstall git
Uninstalling /usr/local/Cellar/git/1.7.5.4...
mbp:~ m$ brew list
ossp-uuid    postgresql    readline
mbp:~ m$ which git  ...can't find git anymore so I must have been using the git installed by homebrew
mbp:~ m$ brew install git
==> Downloading http://kernel.org/pub/software/scm/git/git-1.7.5.4.tar.bz2
...
==> Summary
/usr/local/Cellar/git/1.7.5.4: 1062 files, 19M, built in 15 seconds
mbp:~ m$ brew list
git        ossp-uuid    postgresql    readline
mbp:~ m$ which git  
/usr/local/bin/git  ....yay, homebrew installed git back again
mbp:~ m$

Then I have two remaining questions:
(1) why is which postgresql [readline etc] not returning anything?
(2) how does my system know to look in homebrew's cellar (as it does with git) if there is nothing relating to homebrew in $PATH?

Thanks, Michelle

Last edited by michellepace; 06-25-2011 at 05:42 AM.. Reason: wrapping... not wrapping. make it wrap.
# 2  
Old 06-25-2011
I don't have HOMEBREW installed but to answer your first question, postgresql is not in your path. Try the following :
Code:
ls -lFG /usr/local /usr/local/bin /usr/local/Cellar

I'm guessing that the files in /usr/local/Cellar are directories and however HOMEBREW installs it should put executables or symlinks in /usr/local/bin.
# 3  
Old 06-25-2011
Hi xbin, thanks for your reply. Below is the output from that command. So from memory all the pink ones with "lrwxr-.." are symbolic links(?)
Code:
mbp:~ m$ ls -lFG /usr/local /usr/local/bin /usr/local/Cellar
/usr/local:
total 8
drwxr-xr-x   6 m  staff   204 Jun 25 17:16 Cellar/
drwxr-xr-x   6 m  staff   204 Jun 12 20:17 Library/
-rw-r--r--   1 m  staff  1603 Jun 25 09:57 README.md
drwxr-xr-x  40 m  staff  1360 Jun 25 17:17 bin/
drwxr-xr-x   3 m  staff   102 Jun 12 20:27 etc/
drwxr-xr-x  28 m  staff   952 Jun 12 23:55 include/
drwxr-xr-x  96 m  staff  3264 Jun 12 23:55 lib/
drwxr-xr-x  10 m  staff   340 Jun 25 17:17 share/

/usr/local/Cellar:
total 0
drwxr-xr-x  3 m  staff  102 Jun 25 17:16 git/
drwxr-xr-x  3 m  staff  102 Jun 12 23:53 ossp-uuid/
drwxr-xr-x  3 m  staff  102 Jun 12 23:53 postgresql/
drwxr-xr-x  3 m  staff  102 Jun 12 23:52 readline/

/usr/local/bin:
total 312
-rwxr-xr-x  1 m  staff  4646 Jun 13 00:21 brew*
lrwxr-xr-x  1 m  staff    40 Jun 12 23:55 clusterdb@ -> ../Cellar/postgresql/9.0.4/bin/clusterdb
lrwxr-xr-x  1 m  staff    39 Jun 12 23:55 createdb@ -> ../Cellar/postgresql/9.0.4/bin/createdb
lrwxr-xr-x  1 m  staff    41 Jun 12 23:55 createlang@ -> ../Cellar/postgresql/9.0.4/bin/createlang
lrwxr-xr-x  1 m  staff    41 Jun 12 23:55 createuser@ -> ../Cellar/postgresql/9.0.4/bin/createuser
lrwxr-xr-x  1 m  staff    37 Jun 12 23:55 dropdb@ -> ../Cellar/postgresql/9.0.4/bin/dropdb
lrwxr-xr-x  1 m  staff    39 Jun 12 23:55 droplang@ -> ../Cellar/postgresql/9.0.4/bin/droplang
lrwxr-xr-x  1 m  staff    39 Jun 12 23:55 dropuser@ -> ../Cellar/postgresql/9.0.4/bin/dropuser
lrwxr-xr-x  1 m  staff    35 Jun 12 23:55 ecpg@ -> ../Cellar/postgresql/9.0.4/bin/ecpg
lrwxr-xr-x  1 m  staff    29 Jun 25 17:17:)git@ -> ../Cellar/git/1.7.5.4/bin/git
lrwxr-xr-x  1 m  staff    39 Jun 25 17:17 git-cvsserver@ -> ../Cellar/git/1.7.5.4/bin/git-cvsserver
lrwxr-xr-x  1 m  staff    42 Jun 25 17:17 git-receive-pack@ -> ../Cellar/git/1.7.5.4/bin/git-receive-pack
lrwxr-xr-x  1 m  staff    35 Jun 25 17:17 git-shell@ -> ../Cellar/git/1.7.5.4/bin/git-shell
lrwxr-xr-x  1 m  staff    44 Jun 25 17:17 git-upload-archive@ -> ../Cellar/git/1.7.5.4/bin/git-upload-archive
lrwxr-xr-x  1 m  staff    41 Jun 25 17:17 git-upload-pack@ -> ../Cellar/git/1.7.5.4/bin/git-upload-pack
lrwxr-xr-x  1 m  staff    30 Jun 25 17:17 gitk@ -> ../Cellar/git/1.7.5.4/bin/gitk
lrwxr-xr-x  1 m  staff    37 Jun 12 23:55 initdb@ -> ../Cellar/postgresql/9.0.4/bin/initdb
lrwxr-xr-x  1 m  staff    50 Jun 14 07:38 mate@ -> /Applications/TextMate.app/Contents/Resources/mate
lrwxr-xr-x  1 m  staff    39 Jun 12 23:55 oid2name@ -> ../Cellar/postgresql/9.0.4/bin/oid2name
lrwxr-xr-x  1 m  staff    48 Jun 12 23:55 pg_archivecleanup@ -> ../Cellar/postgresql/9.0.4/bin/pg_archivecleanup
lrwxr-xr-x  1 m  staff    40 Jun 12 23:55 pg_config@ -> ../Cellar/postgresql/9.0.4/bin/pg_config
lrwxr-xr-x  1 m  staff    45 Jun 12 23:55 pg_controldata@ -> ../Cellar/postgresql/9.0.4/bin/pg_controldata
lrwxr-xr-x  1 m  staff    37 Jun 12 23:55 pg_ctl@ -> ../Cellar/postgresql/9.0.4/bin/pg_ctl
lrwxr-xr-x  1 m  staff    38 Jun 12 23:55 pg_dump@ -> ../Cellar/postgresql/9.0.4/bin/pg_dump
lrwxr-xr-x  1 m  staff    41 Jun 12 23:55 pg_dumpall@ -> ../Cellar/postgresql/9.0.4/bin/pg_dumpall
lrwxr-xr-x  1 m  staff    43 Jun 12 23:55 pg_resetxlog@ -> ../Cellar/postgresql/9.0.4/bin/pg_resetxlog
lrwxr-xr-x  1 m  staff    41 Jun 12 23:55 pg_restore@ -> ../Cellar/postgresql/9.0.4/bin/pg_restore
lrwxr-xr-x  1 m  staff    41 Jun 12 23:55 pg_standby@ -> ../Cellar/postgresql/9.0.4/bin/pg_standby
lrwxr-xr-x  1 m  staff    41 Jun 12 23:55 pg_upgrade@ -> ../Cellar/postgresql/9.0.4/bin/pg_upgrade
lrwxr-xr-x  1 m  staff    38 Jun 12 23:55 pgbench@ -> ../Cellar/postgresql/9.0.4/bin/pgbench
lrwxr-xr-x  1 m  staff    39 Jun 12 23:55:eek::confused:postgres@ -> ../Cellar/postgresql/9.0.4 /bin/postgres
lrwxr-xr-x  1 m  staff    41 Jun 12 23:55 postmaster@ -> ../Cellar/postgresql/9.0.4/bin/postmaster
lrwxr-xr-x  1 m  staff    35 Jun 12 23:55 psql@ -> ../Cellar/postgresql/9.0.4/bin/psql
lrwxr-xr-x  1 m  staff    40 Jun 12 23:55 reindexdb@ -> ../Cellar/postgresql/9.0.4/bin/reindexdb
lrwxr-xr-x  1 m  staff    34 Jun 12 23:53 uuid@ -> ../Cellar/ossp-uuid/1.6.2/bin/uuid
lrwxr-xr-x  1 m  staff    41 Jun 12 23:53 uuid-config@ -> ../Cellar/ossp-uuid/1.6.2/bin/uuid-config
lrwxr-xr-x  1 m  staff    39 Jun 12 23:55 vacuumdb@ -> ../Cellar/postgresql/9.0.4/bin/vacuumdb
lrwxr-xr-x  1 m  staff    39 Jun 12 23:55 vacuumlo@ -> ../Cellar/postgresql/9.0.4/bin/vacuumlo

Looking at the above I found that I was just typing in the wrong name... the symbolic link for postgresql is just postgres
Code:
mbp:~ m$ which postgres
/usr/local/bin/postgres

Smilie thanks! Michelle
Login or Register to Ask a Question

Previous Thread | Next Thread

1 More Discussions You Might Find Interesting

1. OS X (Apple)

What is this directory "$(brew --prefix)"? (homebrew)

Hello, I installed the package manager called homebrew a few days ago. Everything seems to be working fine but today I've just noticed this funny looking directory $(brew --prefix). I'm not sure if I made a mistake and duplicated this directory from somewhere else, or if it's suppose to be... (3 Replies)
Discussion started by: michellepace
3 Replies
Login or Register to Ask a Question