-
-
Save cuber/11292869 to your computer and use it in GitHub Desktop.
# you should checkout to the history version of scala.rb | |
cd /path/to/homebrew (default is /usr/local) | |
git checkout d64edec425df44918c58b6b021ffef2628242248 Library/Formula/scala.rb | |
brew info scala # you will see the 2.10 version | |
brew install scala | |
# after install, turn back to the master version | |
brew checkout master Library/Formula/scala.rb | |
# you can install both 2.10 & 2.11, brew switch can easily switch to any specific version | |
brew switch scala 2.10 | |
brew switch scala 2.11 |
I cannot execute #3. It gives me an error that the reference is not a tree.
local (master) $ git checkout d64edec425df44918c58b6b021ffef2628242248 Library/Formula/scala.rb
fatal: reference is not a tree: d64edec425df44918c58b6b021ffef2628242248
I just installed homebrew and the history is only 2 days old. Not sure if that is causing the error.
git fetch --unshallow
solved it for me.
Note: the original code above no longer works. The formula for scala.rb is no longer located in $HOMEBREW/Library/Formula/
I found a solution here: https://github.com/ofishel/hb-scala-2.10.4
brew install homebrew/versions/scala210
brew unlink scala
brew link scala210 --force
brew install homebrew/versions/scala210 would install 2.10.6. I just try
this no longer works with brew
Thank you! This saved my bacon today.
Couple of notes:
After step 4, insert a new step which says:
brew unlink scala
. This allows the install command to proceed. You only need this if you already had Scala 2.11.x installed.Typo in step 7: Change
brew
togit
Finally, for the last two switch commands, my version of homebrew requires specific version numbers... i.e. brew switch scala 2.10.4. So perhaps update the last two commands to read
2.10.x
and2.11.x
.Anyway, thanks for documenting this!