Bison最新版本已安装但尚未使用

gol*_*p04 10 homebrew bison package

$ brew install bison
Warning: bison-3.0.2 already installed
$ bison -V
bison (GNU Bison) 2.3
Run Code Online (Sandbox Code Playgroud)

如何将使用的Bison版本更改为3.0.2?我在OS X 10.9.4上.之后我重启了我的终端$brew install bison.

UPDATE

我真的不确定这是HomeBrew还是Bison的问题.我用MacPorts重新安装了Bison:

$port install bison
......
$bison -V
bison (GNU Bison) 2.7.12-4996
Run Code Online (Sandbox Code Playgroud)

MacPorts没有安装最新版本的Bison,但它确实将使用的Bison版本更改为它安装的版本.

更新$ 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
Run Code Online (Sandbox Code Playgroud)

And*_*rew 35

我刚遇到同样的问题 - 在我的情况下,brew没有创建符号链接.您可以强制执行此操作以通过以下方式获取正确的版本:

$ 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
Run Code Online (Sandbox Code Playgroud)


rje*_*rje 8

在 /usr/local/bin 之前,您的路径中有 /opt/local/bin。Homebrew 默认安装在 /usr/local/bin 中,所以也许你在 /opt/local/bin 中有另一个首先被发现的版本。


Pra*_*wal 6

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

$ brew install bison

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

$ echo 'export PATH="/usr/local/opt/bison/bin:$PATH"' >> ~/.bash_profile

$ export LDFLAGS="-L/usr/local/opt/bison/lib"

$ source ~/.bash_profile
$ bison -V
bison (GNU Bison) 3.4
Run Code Online (Sandbox Code Playgroud)