-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
brew --prefix <formula>
shows path to latest version rather than installed version
#12571
Comments
It might be a bit unintuitive but it's not really bug, or at least it has always behaved this way. I've always understood
to mean exactly that, where "formula" really means only "formula", and once something is installed it is no longer a "formula". See the last few comments on #8196 for discussion about this. |
I should add that the robust way to do what you want is
|
I didn't think that LinkedKegs worked for keg-only formulas... I just installed the Is there any progress on adding a --keg command or similar to provide what I (and I expect most people who use P.S. I see now in the man page it being described like that, I think the Wiki (brew command page) should be updated to match. And yes, it is very unintuitive. |
Yeah, it's wrong. Will fix for brew2! |
Probably can't change Something like |
You can now do this: `brew --prefix`/opt/ack Provided you installed recently, the opt prefix is the prefix of the installed keg. |
I was bit by this issue as well. The percona-server documentation states you need to run the following to initialize the DB:
The brew --prefix call for me results in:
But my installation is in:
Replacing the basedir with the actual path resolves the issue, but it's not apparent at first why this fails. |
Considering how we treat brew --prefix, I will update it to use the opt prefix. |
I just ran into this when trying to use the same I would like to know what I can do to get hold of the path to the currently installed version without using For simplicity I simply upgraded to the newest mysql version to match the path which is provided by Thanks for the efforts by the way. Every time I look through the homebrew code I'm impressed by the brains behind it :) |
My .bashrc has the line:
to use the GNU ls, etc. commands from coreutils.
Recently, I ran
brew update
but did notbrew upgrade coreutils
. Opening new terminals meant that the path was being set incorrectly and I ended up running the standard Mac OS ls, etc. binaries becausebrew --prefix coreutils
was returning /usr/local/Cellar/coreutils/8.17 even though only 8.16 was installed. The wiki says thatbrew --prefix <formula>
prints where the formula is installed, meaning that it's behaviour of using the latest version rather than the installed version is incorrect, and it will cause problems with all automated scripts (such as the recommended bashrc addition above) that use it.The text was updated successfully, but these errors were encountered: