尝试安装 scala 时 Mac OS Mavericks 中的 Homebrew 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19566908/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Homebrew errors in Mac OS Mavericks when trying to install scala
提问by skiabox
I just installed Mavericks and I tried brew install scalato install scala language but it failed.
Then I typed brew updatebut still installation of scala fails.
So I post the brew doctorcommand to help readers of stackoverflow helping me with this problem.
Here is the result :
我刚刚安装了 Mavericks 并尝试brew install scala安装 scala 语言,但它失败了。然后我输入brew update但仍然安装scala失败。所以我发布brew doctor命令来帮助stackoverflow的读者帮助我解决这个问题。结果如下:
$ brew doctor
Warning: /usr/local/etc isn't writable. This can happen if you "sudo make install" software that isn't managed by by Homebrew. If a brew tries to write a file to this directory, the install will fail during the link step.
You should probably
chown/usr/local/etcWarning: Some directories in /usr/local/share/man aren't writable. This can happen if you "sudo make install" software that isn't managed by Homebrew. If a brew tries to add locale information to one of these directories, then the install will fail during the link step. You should probably
chownthem:/usr/local/share/man/man8Warning: "config" scripts exist outside your system or Homebrew directories.
./configurescripts 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:
/opt/local/bin/libpng-config /opt/local/bin/libpng15-config /opt/local/bin/ncurses5-config /opt/local/bin/ncursesw5-config /opt/local/bin/pkg-config /opt/local/bin/xml2-configWarning: You have MacPorts or Fink installed: /opt/local/bin/port
This can cause trouble. You don't have to uninstall them, but you may want to temporarily move them out of the way, e.g.
sudo mv /opt/local ~/macports
Warning: Unbrewed dylibs were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted.
Unexpected dylibs: /usr/local/lib/libicudata.49.1.2.dylib /usr/local/lib/libicui18n.49.1.2.dylib /usr/local/lib/libicuio.49.1.2.dylib /usr/local/lib/libicule.49.1.2.dylib /usr/local/lib/libiculx.49.1.2.dylib /usr/local/lib/libicutest.49.1.2.dylib /usr/local/lib/libicutu.49.1.2.dylib /usr/local/lib/libicuuc.49.1.2.dylib
Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted.
Unexpected .pc files: /usr/local/lib/pkgconfig/icu-i18n.pc /usr/local/lib/pkgconfig/icu-io.pc /usr/local/lib/pkgconfig/icu-le.pc /usr/local/lib/pkgconfig/icu-lx.pc /usr/local/lib/pkgconfig/icu-uc.pc
Warning: Unbrewed static libraries were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted.
Unexpected static libraries: /usr/local/lib/libc-client.a
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 linkon these:scalaWarning: Homebrew's sbin was not found in your PATH but you have installed formulae that put executables in /usr/local/sbin. Consider setting the PATH for example like so echo export PATH="/usr/local/sbin:$PATH" >> ~/.bash_profile
Warning: You have a non-Homebrew 'pkg-config' in your PATH:
/opt/local/bin/pkg-config
./configuremay have problems finding brew-installed packages using this other pkg-config.
$ 酿造医生
警告:/usr/local/etc 不可写。如果您“sudo make install”不是由 Homebrew 管理的软件,就会发生这种情况。如果 brew 尝试将文件写入此目录,则在链接步骤期间安装将失败。
你可能应该
chown/usr/local/etc警告: /usr/local/share/man 中的某些目录不可写。如果您使用不受 Homebrew 管理的“sudo make install”软件,就会发生这种情况。如果 brew 尝试将区域设置信息添加到这些目录之一,则安装将在链接步骤期间失败。你可能应该
chown:/usr/local/share/man/man8警告:“config”脚本存在于您的系统或 Homebrew 目录之外。
./configure脚本通常会查找 *-config 脚本来确定是否安装了软件包,以及在编译和链接时要使用的附加标志。如果配置脚本覆盖了系统或 Homebrew 提供的同名脚本,则在您的路径中包含其他脚本可能会混淆通过 Homebrew 安装的软件。我们发现了以下“配置”脚本:
/opt/local/bin/libpng-config /opt/local/bin/libpng15-config /opt/local/bin/ncurses5-config /opt/local/bin/ncursesw5-config /opt/local/bin/pkg-config /opt/local/bin/xml2-config警告:您安装了 MacPorts 或 Fink:/opt/local/bin/port
这可能会导致麻烦。您不必卸载它们,但您可能希望暂时将它们移开,例如
须藤 mv /opt/local ~/macports
警告:在 /usr/local/lib 中发现了未酿造的 dylib。如果您不是故意将它们放在那里,它们可能会在构建 Homebrew 公式时导致问题,并且可能需要删除。
意外的动态库:/usr/local/lib/libicudata.49.1.2.dylib /usr/local/lib/libicui18n.49.1.2.dylib /usr/local/lib/libicuio.49.1.2.dylib /usr/local/ lib/libicule.49.1.2.dylib /usr/local/lib/libiculx.49.1.2.dylib /usr/local/lib/libicutest.49.1.2.dylib /usr/local/lib/libicutu.49.1.2。 dylib /usr/local/lib/libicuuc.49.1.2.dylib
警告:在 /usr/local/lib/pkgconfig 中发现了未酿造的 .pc 文件。如果您不是故意将它们放在那里,它们可能会在构建 Homebrew 公式时导致问题,并且可能需要删除。
意外的 .pc 文件:/usr/local/lib/pkgconfig/icu-i18n.pc /usr/local/lib/pkgconfig/icu-io.pc /usr/local/lib/pkgconfig/icu-le.pc /usr/本地/lib/pkgconfig/icu-lx.pc /usr/local/lib/pkgconfig/icu-uc.pc
警告:在 /usr/local/lib 中发现了未酿造的静态库。如果您不是故意将它们放在那里,它们可能会在构建 Homebrew 公式时导致问题,并且可能需要删除。
意外的静态库:/usr/local/lib/libc-client.a
警告:您的酒窖中有未链接的小桶 未链接小桶会导致构建问题,并导致依赖这些小桶的啤酒在构建后无法正常运行。运行
brew link这些:scala警告:在您的 PATH 中找不到 Homebrew 的 sbin,但您已经安装了将可执行文件放在 /usr/local/sbin 中的公式。考虑设置 PATH 例如像这样 echo export PATH="/usr/local/sbin:$PATH" >> ~/.bash_profile
警告:您的路径中有一个非 Homebrew 'pkg-config':
/opt/local/bin/pkg-config
./configure使用此其他 pkg-config 查找 brew 安装的软件包可能会遇到问题。
brew install scala gives :
brew install scala 给出:
Warning: It appears you have MacPorts or Fink installed. Software installed with other package managers causes known problems for Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again. Warning: scala-2.10.3 already installed, it's just not linked
警告:您似乎安装了 MacPorts 或 Fink。与其他包管理器一起安装的软件会导致 Homebrew 出现已知问题。如果公式无法构建,请卸载 MacPorts/Fink 并重试。警告:scala-2.10.3 已经安装,只是没有链接
回答by
The installation went fine, it's just not providing a symbolic link to /usr/local/bin, because it's "afraid" of messing around with macports.
安装很顺利,只是没有提供到 的符号链接/usr/local/bin,因为它“害怕”弄乱 macports。
As it says in the doctor message, first change the permissions in /usr/local/etc:
正如医生消息中所说,首先更改权限/usr/local/etc:
chown <username> /usr/local/etc
probably with sudoprepended (sudo chown <username> /usr/local/etc).
可能带有sudo前置 ( sudo chown <username> /usr/local/etc)。
Now brew can update the necessary files and link scala:
现在 brew 可以更新必要的文件并链接 scala:
brew link scala
and you might be fine.
你可能会没事的。
回答by Arun
If you still face the issue please follow the below steps:
如果您仍然遇到问题,请按照以下步骤操作:
fix owner of files and folders recursively
递归修复文件和文件夹的所有者
sudo chown -vR $(whoami) /usr/local /opt/homebrew-cask /Library/Caches/Homebrew
须藤 chown -vR $(whoami) /usr/local /opt/homebrew-cask /Library/Caches/Homebrew
fix read/write permission of files and folders recursively
递归修复文件和文件夹的读/写权限
chmod -vR ug+rw /usr/local /opt/homebrew-cask /Library/Caches/Homebrew
chmod -vR ug+rw /usr/local /opt/homebrew-cask /Library/Caches/Homebrew
fix execute permission of folders recursively
递归修复文件夹的执行权限
find /usr/local /opt/homebrew-cask /Library/Caches/Homebrew -type d -exec chmod -v ug+x {} +
查找 /usr/local /opt/homebrew-cask /Library/Caches/Homebrew -type d -exec chmod -v ug+x {} +
below is the link.
下面是链接。
https://gist.github.com/stefanschmidt/047001373d1defc90b6bdd7820e92cf7
https://gist.github.com/stefanschmidt/047001373d1defc90b6bdd7820e92cf7

