我从mac系统中删除了文件夹/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/
中的一些 .rb文件(cassandra.rb,cassandra @ 2.1.rb和cassandra@2.2.rb)。我想要回复这些文件。 rb文件。
我以为brew upgrade
会把那些已删除的.rb文件还给我。但是它们仍然缺失。那些.rb文件对我来说很重要。
brew install cassandra
给出了
Updating Homebrew...
Error: No available formula with the name "cassandra"
==> Searching for a previously deleted formula...
cassandra was deleted from homebrew/core in commit d20fe73:
cassandra: update 3.10_1 bottle.
To show the formula before removal run:
git -C "$(brew --repo homebrew/core)" show d20fe73^:Formula/cassandra.rb
If you still use this formula consider creating your own tap:
http://docs.brew.sh/How-to-Create-and-Maintain-a-Tap.html
我需要解决方案“如何取回这些.rb文件?”或“安装cassandra的其他任何替代方法”。
答案 0 :(得分:2)
直接从GitHub安装,如下所述 - How to restore brew formula after I rm it
brew install https://github.com/Homebrew/homebrew-core/tree/master/Formula/cassandra.rb
答案 1 :(得分:0)
尝试此命令可以恢复所有已删除的文件
注意:此命令将还原$(brew --repo homebrew/core)
cd $(brew --repo homebrew/core) && git reset --hard origin/master
Homebrew在内部使用git,所以使用git命令修复一些问题。