how can I homebrew install gradle 1.12? - ruby-on-rails

I currently have 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?

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.

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
https://github.com/gradle/gradle.git
Also you you might be struggling with the wrong version being listed in your ruby dependencies file.
However to install another version of gradle (assuming you have the most recent one, if you don't I can help too):
Check to see if you have the older version of gradle with: $ brew info gradle
If the version you want exists, switch versions $ brew switch gradle SOME_VERSION where you replace SOME_VERSION with the version number you want (and was shown to be installed).
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?

To install different versions of the software package with 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

Related

Cabal cannot resolve dependencies for Idris

I'm new to the Haskell ecosystem and trying to install Idris on my MacOS Catalina.
So after
$ brew install ghc
$ brew install cabal-install
I have The Glorious Glasgow Haskell Compilation System, version 8.8.2 and cabal-install version 3.0.0.0. Then I'm trying to install Idris but
$ cabal update; cabal install idris
from official docs fails with
Resolving dependencies... cabal: Could not resolve dependencies: [__6]
fail (backjumping, conflict set: template-haskell, text, time) After
searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: hashable, trifecta, base,
idris, text, template-haskell, time, pretty, blaze-builder,
blaze-markup, idris:setup.Cabal, zlib, unordered-containers, ivor,
optparse-applicative Try running with --minimize-conflict-set to
improve the error message.
Running with the flag mentioned in message doesn't help too.
Should I try building from sources or is there any other good way to fix this error?
This PR supporting those versions was just merged in January: https://github.com/idris-lang/Idris-dev/pull/4808
However, the last release on Hackage was July of last year:
http://hackage.haskell.org/package/idris
So I'd assume the currently released version doesn't build on GHC 8.8.
You could build current master from the git repo.
Or you could install the idris-current.pkg binary from https://www.idris-lang.org/download/ instead of building it yourself from source.
On Linux I needed to install zlib outside of cabal, you might need to do that. I see that in your list of failed packages.

Homebrew: How do you specify a version using brew cask?

How do I specify a version number when installing something with brew cask install?
For recent versions of Homebrew, Jethro' instructions below may not work work, because we will get an error like:
Invalid usage: Non-checksummed download of <FORMULA_NAME> formula file from an arbitrary URL is unsupported.
I found a workaround:
Go to the Homebrew Cask search page: https://formulae.brew.sh/cask/
Type and find the application you are looking for
Click Cask code link
On Github click History button
Find the version you need by reading the commit messages and view the raw file. Confirm the version variable (normally on line 2) is the version you need.
Click on the name of the commit, then three dots and select View file
Right-click Raw button and Save Link As... to download the file locally
When downloaded, go to download directory cd Downloads/
Finally run brew install --cask <FORMULA_NAME>.rb
Voilà 😄
If you need some visual assistance check the screenshots here.
You can manually point brew at the ruby file for a specific version of a cask, using a git hash. This lets you control which version is installed.
For example:
Find the cask .rb file on the homebrew-cask git repo that you
want.
Get the commit hash, eg
cee7983cd95fc92fdc250fc509f2379cefe647fe in the example above.
Git may give you instructions to view the file history locally - eg git clone https://github.com/Homebrew/homebrew-cask.git git log master -- Casks/CASK_NAME.rb
Point brew at the file using the hash: brew cask install https://raw.githubusercontent.com/caskroom/homebrew-cask/cee7983cd95fc92fdc250fc509f2379cefe647fe/Casks/minikube.rb
The other answers are pretty heavy handed, an alternative is to use the homebrew/cask-versions tap which contains a list of the old (major) versions of casks.
To use them tap it with brew tap homebrew/cask-versions and then you can search for your cask again like brew search --cask yourformula and see if what you're looking for is there.
Or you can see the complete list of casks by clicking on Casks folder at https://github.com/Homebrew/homebrew-cask-versions .
If you run
brew edit [formula]
you can change the version that matches your operating system. If you know the checksum, enter that too. If not, just comment that line out with # and it will skip the check. Then run
HOMEBREW_NO_INSTALL_FROM_API=1 brew reinstall [formula]

Is it possible to get Homebrew to install from the latest commit on GitHub?

I need to use the LFTP program for a script I run. I tried installing it from the website using the instructions in the downloaded folder's "INSTALL" file, but running config always failed. So, I tried to have Homebrew install it, and that worked great.
I have no idea where Homebrew fetches its source from, but the latest version it pulled has a bug which the developer has since fixed on GitHub. Is there a way I can get Homebrew to install the source from the latest commit?
Some packages, such as numpy have a --HEAD option.
--HEAD
Install HEAD version
but the lftp package doesn't have this option. One solution could be to implement it yourserlf:
brew edit lftp
P.S. the homebrew version of lftp already include a patch:
https://raw.githubusercontent.com/macports/macports-ports/edf0ee1e2cf/devel/m4/files/secure_snprintf.patch
it's maybe the same you are looking for. You can see how it's apply whit brew edit lftp.

How to install a specific version of swiftlint?

I am trying to fix this error:
Error: swiftlint does not have a version "0.11.1" in the Cellar.
by running this:
brew install swiftlint-0.11.1
however this doesn't work, then I tried "brew search swiftlint", but nothing showed up.
Can anyone point to me the correct way to install swiftlint with a specific version?
Go to /usr/local/Cellar/swiftlint you will see all installed switflint version.
Copy swiftlint version folder from other Mac then paste into /usr/local/Cellar/swiftlint
You could check all versions in your Mac by brew info swiftlint
Switch to version you need by brew switch swiftlint x.xx.x
I uploaded some version ==> here
Update: Now you could use pods for this.
My project is using swift2.2 with SwiftLint 0.12.0 installed via brew.
And I decided to change to Pod. There are many changes and errors in each versions. My project is too big, and it's take time to fix all the error and warning (it may effect to current features also...).
Finally I choose pod 'SwiftLint', '0.16.0' and. disable_rules then I don't need to fix any warning nor error.
type_name
shorthand_operator
unused_closure_parameter
This involves a lot of steps, but anyway:
Find the Brew Formula for Swiftlint. It's here.
Now you'll need an older commit of Swift Lint, so you would normally click on the History tab and get to an older commit. However, GitHub might tell you that you need to clone the repo (git#github.com:Homebrew/homebrew-core.git) and then use git log master -- Formula/swiftlint.rb to find your older commit. I'll spare you the details of that.
Now you need a raw URL for an older commit. So the raw URL for the latest commit is https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/swiftlint.rb, but you would use https://github.com/Homebrew/homebrew-core/blob/COMMIT/Formula/swiftlint.rb
Now you can do a brew install directly using this older Swift Lint. In my case, I needed 0.15, so I used:
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/864095ea97b6d7dc88c772c7f9f36521cf81a77e/Formula/swiftlint.rb
Just go to Swiftlint release page and select the appropriate version.
Download it and extract it.
You should be able to see an executable and a licence txt file.
Now go to /usr/local/Cellar/swiftlint and create a folder with the version (for ex. 0.35.0).
Create a bin folder inside it and paste the swiftlint executable that you have downloaded.
Brew now shows the custom version that you have downloaded . You can check by typing brew info swiftlint in cmd
you can switch by brew switch swiftlint version_number
With mint, which I personally prefer, you can do:
mint install realm/SwiftLint#0.46.2
Go to the SwiftLint's releases section and find the version you're looking for.
Then download its installer (.pkg, .zip, etc), and run it.

Install later version of docker-engine stuck on Travis build

Because I need a newer version of docker-compose, I also need a newer version of docker-engine. I tried:
before_install:
- sudo apt-get install -qq docker-engine
However, the build gets stuck at a prompt:
Configuration file '/etc/default/docker'
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** docker (Y/I/N/O/D/Z) [default=N] ?
How do I make it keep the old version without blocking? (Or should I accept the new version? I'm guessing Travis CI is doing some stuff to it...)
I tried sudo apt-get remove -qq docker-engine first, which didn't seem to do anything.
Make sure you're using the right Travis CI environment, the Trusty beta environment.
Then see the Travis docs for updating your Docker Compose here.

Resources