bash 我如何自制安装 gradle 1.12?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25042967/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 10:59:39  来源:igfitidea点击:

how can I homebrew install gradle 1.12?

ruby-on-railsgitbashshellgradle

提问by Elad Benda2

I currently have gradle 1.10

我目前有 gradle 1.10

I have tried:

我试过了:

brew versions gradle 

and then:

进而:

git checkout 8ef0672 /usr/local/Library/Formula/gradle.rb

because I saw:

因为我看到了:

1.12     git checkout 8ef0672 /usr/local/Library/Formula/gradle.rb

but got this error:

但得到这个错误:

fatal: Not a git repository (or any of the parent directories): .git

how can I install specific gradle version using homebrew?

如何使用自制软件安装特定的 gradle 版本?

回答by stevebot

Do something like this:

做这样的事情:

cd $(brew --prefix)
brew versions gradle
## copy and run the git checkout for your desired gradle version
brew unlink gradle
brew install gradle

That worked for me. I am on a Mac OSX though.

那对我有用。不过我在 Mac OSX 上。

回答by Jono

First the problem with your git request, is you are trying to pull a non git repository. An example of what a git repo looks like is

首先是你的 git 请求的问题,是你试图拉一个非 git 存储库。git repo 的一个例子是

https://github.com/gradle/gradle.git

https://github.com/gradle/gradle.git

Also you you might be struggling with the wrong version being listed in your ruby dependencies file.

此外,您可能正在为 ruby​​ 依赖项文件中列出的错误版本而苦苦挣扎。

However to install another version of gradle (assuming you have the most recent one, if you don't I can help too):

但是,要安装另一个版本的 gradle(假设您有最新版本,如果没有,我也可以提供帮助):

  1. Check to see if you have the older version of gradle with: $ brew info gradle
  2. If the version you want exists, switch versions $ brew switch gradle SOME_VERSIONwhere you replace SOME_VERSION with the version number you want (and was shown to be installed).
  1. 检查您是否拥有旧版本的 gradle: $ brew info gradle
  2. 如果您想要的版本存在,请切换$ brew switch gradle SOME_VERSION将 SOME_VERSION 替换为您想要的版本号的版本(并显示已安装)。

In the interest of not being redundant, if you don't have the version desired installed refer to this other post: Homebrew install specific version of formula?

为了避免冗余,如果您没有安装所需的版本,请参阅另一篇文章:Homebrew 安装特定版本的公式?

回答by Renien

To install different versions of the software package with homebew,

用homebew安装不同版本的软件包,

brew tap homebrew/versions 

Search for the desired package:

搜索所需的包:

brew search gradle 

The results :

结果 :

gradle                              homebrew/versions/gradle18          homebrew/versions/gradle24        
homebrew/versions/gradle110         homebrew/versions/gradle20          homebrew/versions/gradle26        
homebrew/versions/gradle112         homebrew/versions/gradle21          homebrew/versions/gradle27        
homebrew/versions/gradle16          homebrew/versions/gradle221         homebrew/versions/gradle28        
Caskroom/cask/qlgradle

Now chose your desired version:

现在选择您想要的版本:

brew install homebrew/versions/gradle112