【问题标题】:Homebrew error updating git in mac os在 mac os 中更新 git 的 Homebrew 错误
【发布时间】:2015-05-26 21:49:08
【问题描述】:

macbook os 10.7.5上更新git出现以下问题

我已经安装并更新了自制软件。

which git        
/usr/local/git/bin/git
git --version 
git version 1.8.3.2
brew upgrade git 
ERROR: git 2.4.1 already installed

在尝试包含之后

 export PATH=/usr/local/git/bin/git:$PATH 

在我的 ~.bashrc 文件中,仍然没有骰子。 此外,某些博客文章引用了 .bash_profile 虽然我没有那个文件,只有 ~.bashrc

以防万一,我将包含 brew doctor 错误:

Warning: /usr/local/sbin isn't writable.

This can happen if you "sudo make install" software that isn't managed by Homebrew.
If a formula tries to write a file to this directory, the install will fail during
 the link step.

You should probably `chown` /usr/local/sbin

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use 
when compiling and linking.

Having additional scripts in your path can confuse software installed via Homebrew 
if the config script overrides a system or Homebrew provided script of the same 
name. We found the following "config" scripts:

  /Library/Frameworks/Python.framework/Versions/Current/bin/python-config
  /Library/Frameworks/Python.framework/Versions/Current/bin/python2.5-config/usr/local/rvm/gems/ruby-1.9.3-p194/bin/passenger-config
/opt/sm/pkg/active/bin/curl-config
  /opt/sm/pkg/active/bin/ncurses5-config
  /opt/sm/pkg/active/bin/ncursesw5-config
  /opt/sm/pkg/active/bin/pkg-config
  /opt/sm/pkg/active/bin/xml2-config
  /opt/sm/pkg/active/bin/xslt-config

Warning: Python is installed at /Library/Frameworks/Python.framework

Homebrew only supports building against the System-provided Python or a 
brewed Python. In particular, Pythons installed to /Library can interfere
with other software installs.

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:

iftop

Warning: You have a non-Homebrew 'pkg-config' in your PATH:
  /opt/sm/pkg/active/bin/pkg-config

`./configure` may have problems finding brew-installed packages using
 this other pkg-config.

提前感谢任何提示或建议。

【问题讨论】:

  • 您是否记得在进行更改后执行source .bashrc
  • 我没有,尽管自制的 git 版本似乎仍然位于其他地方。

标签: git macos upgrade homebrew


【解决方案1】:

在 Mac 上,苹果为您设置了 apple-git,因此您需要将其删除。运行以下命令来设置最新的 git 版本。

酿造安装 git

git --version
git version XX.XX.XX (Apple Git-XX)
which git
       ...
// doh! osx's pre-installed git trumps the brew one, so:
sudo mv /usr/bin/git /usr/bin/git-apple
which git
    /usr/local/bin/git
git --version
    git version 2.X.X

【讨论】:

  • 当我运行 git --version 时,(Apple Git-XX) 未列出。它只是说和上面一样。
  • 你是在Iterm还是在默认终端检查?
  • 我正在使用终端。仍然显示与上面相同的 git 和版本。也许 python 框架正在支持家庭酿造?我可以将它们从 .bashrc 中取出并将它们重新定位到其他地方吗?我需要一个 .bash_profile 文件吗?我没有看到。
  • 这个解决方案已经有 3 年历史了,但它帮了我很大的忙。现在的问题是:如何确保我使用的是较新版本的 git?
猜你喜欢
  • 1970-01-01
  • 2016-11-23
  • 2016-08-15
  • 2018-10-20
  • 1970-01-01
  • 2013-11-03
  • 1970-01-01
  • 2013-02-08
  • 1970-01-01
相关资源
最近更新 更多