找不到Unison命令

时间:2017-11-07 18:52:58

标签: homebrew unison

最近我的Unison应用程序已停止在我的Mac终端上工作,说无法找到该命令。不确定这是不是因为我最近重新安装了brew(它是如何安装的),这可能会破坏它。

以下是错误输出:

mac:~ Imran$ unison sites
-bash: unison: command not found

我可以看到,如果在以下目录中找到locate unison unison:

> /Users/Imran/unison.log /Users/Imran/unison.tar.gz
> /usr/local/Cellar/unison /usr/local/Cellar/unison/2.40.102
> /usr/local/Cellar/unison/2.40.102/COPYING
> /usr/local/Cellar/unison/2.40.102/INSTALL_RECEIPT.json
> /usr/local/Cellar/unison/2.40.102/NEWS
> /usr/local/Cellar/unison/2.40.102/README
> /usr/local/Cellar/unison/2.40.102/TODO.txt
> /usr/local/Cellar/unison/2.40.102/bin
> /usr/local/Cellar/unison/2.40.102/bin/unison
> /usr/local/Library/Formula/unison.rb
> /usr/local/Library/LinkedKegs/unison /usr/local/bin/unison
> /usr/local/opt/unison /usr/share/zsh/5.3/functions/_unison

有人可以帮助我重新开始工作吗?我怀疑它与应用程序被破坏的链接有关。

4 个答案:

答案 0 :(得分:1)

如果您重新安装了一个酿酒桶,那么如果您在路径中找不到它,则可能需要再次手动链接它。

brew link unison

答案 1 :(得分:0)

根据documentation,错误消息bash: unison: command not found表示:

确保您要连接的主机上已安装Unison。

答案 2 :(得分:0)

对于在 macOS 上遇到此错误的任何人: 如果您使用 implementation fileTree(dir: "libs", include: ["*.jar"]) implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.1' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'com.google.android.material:material:1.2.0' implementation 'androidx.navigation:navigation-fragment:2.3.0' implementation 'androidx.navigation:navigation-ui:2.3.0' implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.preference:preference:1.1.0' implementation "androidx.startup:startup-runtime:1.0.0" //GOOGLE PLAY SERVICES implementation 'com.google.android.gms:play-services-location:18.0.0' implementation 'com.google.android.gms:play-services-vision:20.1.3' implementation 'com.google.android.gms:play-services-maps:17.0.0' implementation 'com.google.android.gms:play-services-ads:19.7.0' // Google Sign In SDK (only required for Google Sign In) implementation 'com.google.android.gms:play-services-auth:19.0.0' implementation 'com.google.android.gms:play-services-base:17.6.0' implementation 'com.google.android.gms:play-services-auth-api-phone:17.5.0' implementation 'com.google.android.gms:play-services-identity:17.0.0' //places implementation 'com.google.android.gms:play-services-places:17.0.0' implementation 'com.google.android.libraries.places:places:1.1.0' def multidex_version = "2.0.1" implementation "androidx.multidex:multidex:$multidex_version" //maps implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0' implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0' implementation project(path: ':app:libs:linkedin-sdk') implementation project(path: ':app:libs:ntp:library') implementation project(path: ':app:libs:ntp:library-extension-rx') implementation "io.reactivex.rxjava2:rxandroid:2.0.2" testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' implementation 'androidx.leanback:leanback-preference:1.0.0' implementation "android.arch.lifecycle:extensions:1.1.1" implementation 'com.google.firebase:firebase-messaging:20.2.4' implementation 'com.google.firebase:firebase-auth:19.3.2' implementation 'com.google.firebase:firebase-database:19.5.0' //implementation 'com.firebaseui:firebase-ui-database:1.0.1' implementation 'com.google.firebase:firebase-analytics:17.5.0' implementation 'com.google.firebase:firebase-storage:19.1.1' implementation 'com.google.firebase:firebase-functions:19.0.2' // Facebook Android SDK (only required for Facebook Login) implementation 'com.facebook.android:facebook-android-sdk:[5,6)' //twitter implementation 'com.twitter.sdk.android:twitter:3.1.1' implementation 'com.squareup.picasso:picasso:2.5.2' //billing implementation 'com.android.billingclient:billing:3.0.0' //geo fire implementation 'com.firebase:geofire-android:3.0.0' //gson implementation 'com.google.code.gson:gson:2.8.6' // Room Architecture Components. implementation 'android.arch.persistence.room:runtime:1.1.1' annotationProcessor 'android.arch.persistence.room:compiler:1.1.1' //biometrics implementation 'androidx.biometric:biometric:1.0.1' implementation 'com.fasterxml.jackson.core:jackson-core:2.10.1' implementation 'com.fasterxml.jackson.core:jackson-annotations:2.10.1' implementation 'com.fasterxml.jackson.core:jackson-databind:2.10.1' implementation 'org.whispersystems:signal-service-android:2.13.9' (或运行更新的 macOS 版本,其中 zsh 是默认值),您必须修改或创建 zsh

通过将以下代码段之一添加到 ~/.zshenv 来添加 shell 环境的路径。

对于 ARM64(M1 Mac):

~/.zshenv

或在 x86(英特尔 Mac)上

eval $(/opt/homebrew/bin/brew shellenv)

或者您只是获取您的eval $(/usr/local/bin/brew shellenv)

zshrc

答案 3 :(得分:-1)

您用户的 PATH 变量不包含指向 unison 二进制文件的链接。

将/usr/local/Cellar/unison/2.40.102/bin/unison添加到.bashrc,

$ vi ~/.bashrc

添加以下内容,

export PATH=$PATH:/usr/local/Cellar/unison/2.40.102/bin/unison

保存并退出,然后重新读取您的用户bashrc文件,

exec bash

现在再次尝试哪个联合,或者实际上只是尝试使用

运行它
$ unison