Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bison latest version installed but not in use

$ brew install bison
Warning: bison-3.0.2 already installed
$ bison -V
bison (GNU Bison) 2.3

How can I change the Bison version in use to 3.0.2? I'm on OS X 10.9.4. I've restarted my terminal after $brew install bison.

UPDATE

I'm really not sure if this is a problem of HomeBrew or Bison. I reinstalled Bison with MacPorts:

$port install bison
......
$bison -V
bison (GNU Bison) 2.7.12-4996

MacPorts did not install the latest version of Bison, but it did change the Bison version in use to the one it installed.

UPDATE ON $PATH

$echo $PATH
/opt/local/bin:/opt/local/sbin:/usr/local/bin:/Users/my_user_name/.rbenv/shims:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki:/usr/local/mysql/bin:/Users/my_user_name/code/bin:/Users/my_user_name/code/bin/git:/Users/my_user_name/code/bin/old_git:/Users/my_user_name/code/bin:/Users/my_user_name/code/bin/git:/Users/my_user_name/code/bin/old_git:/Users/my_user_name/.rvm/bin
like image 608
goldfrapp04 Avatar asked Jul 18 '14 23:07

goldfrapp04


People also ask

How do I find my Bison version?

Test releases of Bison can be found at http://alpha.gnu.org/gnu/bison/ (via HTTP) and ftp://alpha.gnu.org/gnu/bison/ (via FTP).


2 Answers

I just ran into the same issue - in my case brew wasn't creating the symlinks. You can force this in order to get the right version via:

$ brew unlink bison
Unlinking /usr/local/Cellar/bison/3.0.4... 0 symlinks removed

$ brew link bison
Warning: bison is keg-only and must be linked with --force
Note that doing so can interfere with building software.

$ brew link bison --force
Linking /usr/local/Cellar/bison/3.0.4... 9 symlinks created

$ source ~/.bash_profile
$ bison -V
bison (GNU Bison) 3.0.4
like image 76
Andrew Avatar answered Sep 18 '22 08:09

Andrew


You have /opt/local/bin in your path before /usr/local/bin. Homebrew installs in /usr/local/bin by default so maybe you have another version in /opt/local/bin that gets found first.

like image 21
rje Avatar answered Sep 19 '22 08:09

rje