简体   繁体   English

卸载MacRuby

[英]Uninstall MacRuby

Does anyone know how to uninstall MacRuby? 有谁知道如何卸载MacRuby? I was using RubyCocoa then decided to try out MacRuby, after installing MacRuby, RubyCocoa has stopped working. 我使用RubyCocoa然后决定试用MacRuby,安装MacRuby后,RubyCocoa已经停止工作了。 So I would like to remove MacRuby, but I cannot find any documentation on how to uninstall it. 所以我想删除MacRuby,但我找不到任何有关如何卸载它的文档。

The given answers won't remove everything. 给出的答案不会删除所有内容。 You'll still have XCode templates, examples and a few other dangling sym links: to rb_nibtool and the macruby man page. 你仍然会有XCode模板,示例和一些其他悬空sym链接:到rb_nibtool和macruby手册页。

To clean this up you need the .pkg file used to install MacRuby in the first place. 要清理它,首先需要用于安装MacRuby的.pkg文件。 This gives you a list of all files installed which you can delete. 这将为您提供可以删除的所有已安装文件的列表。 I did this: 我这样做了:

$ xar -xf macruby_nightly.pkg
$ lsbom macrubynightly.pkg/Bom # not a typo, the above archive contains this folder

It would be nice if there were a better way to do this... 如果有更好的方法可以做到这一点会很好......

There is an easier way to list files in an installed package: 有一种更简单的方法可以列出已安装包中的文件:

$ pkgutil --pkgs # list IDs of all installed packages
$ pkgutil --pkgs |grep -i ruby # get all related to ruby
$ pkgutil --files com.apple.macruby.macruby.MacRuby-0.pkg # show all files for MacRuby-0.8

If you delete the files, be sure to remove the receipt, as well (/Library/Receipts): 如果删除文件,请务必删除收据(/ Library / Receipts):

$ sudo pkgutil --forget com.apple.macruby.macruby.MacRuby-0.pkg

If you don't remove the receipt, you could have trouble reinstalling later (usually only for previous versions of the same package). 如果您不删除收据,则可能在以后重新安装时遇到问题(通常仅针对同一软件包的先前版本)。

You can also delete all the files using pkgutil: 您还可以使用pkgutil删除所有文件:

$ sudo pkgutil --unlink com.apple.macruby.macruby.MacRuby-0.pkg

The docs are not great (for me, at least) and I was a little scared to try it - it looked like it wanted to be overly-aggressive in deleting/unlinking things it didn't "own" (eg, it tried to unlink /usr). 文档不是很好(对我来说,至少)并且我有点害怕尝试它 - 看起来它想要删除/取消链接它没有“拥有”的东西过于激进(例如,它试图unlink / usr)。

In the end, I made sure that Time Machine was working and ran the command. 最后,我确保Time Machine正在运行并运行命令。 It deletes all the files and leaves behind all the empty directories. 它删除所有文件并留下所有空目录。 That's dumb, but safe enough. 那是愚蠢的,但足够安全。 I'm sure someone has written a script to wrap all this up into a single safe operation, but I just cleaned up by hand. 我确定有人写了一个脚本将所有这些包装成一个安全的操作,但我只是手工清理。

Also, '--unlink' does not imply '--forget', so you also still need to run that after. 此外,“--unlink” 并不意味着“--forget”,所以你也仍然需要,经过运行。

Dj2 is right, to uninstall MacRuby: Dj2是对的,卸载MacRuby:

$ rm -rf /Library/Frameworks/MacRuby.framework
$ rm /usr/local/bin/mac*
$ rm /usr/local/bin/hotcocoa

However, MacRuby and RubyCocoa can live side by side in perfect harmony ;) 但是,MacRuby和RubyCocoa可以完美和谐地生活在一起;)

I believe everything for MacRuby is installed into /Library/Frameworks/MacRuby.framework. 我相信MacRuby的所有内容都安装在/Library/Frameworks/MacRuby.framework中。 While I haven't tried it myself, removing that directory should remove MacRuby from the system. 虽然我自己没有尝试过,但删除该目录应该从系统中删除MacRuby。

MacRuby shouldn't interact with RubyCocoa in such a way as to cause it to stop working. MacRuby不应该以导致它停止工作的方式与RubyCocoa交互。 It maybe the case that something else on your system changed at about the same time as the MacRuby install. 可能的情况是,您的系统上的其他内容在与MacRuby安装的大致相同的时间发生了变化。

This is from Matt Aimonetti's "MacRuby: The Definitive Guide" (O'Reilly): 这是来自Matt Aimonetti的“MacRuby:The Definitive Guide”(O'Reilly):

"MacRuby does not come with an uninstaller. If you want to remove MacRuby from your computer, delete the MacRuby binary files, which use the mac prefix and are located in /usr/local/bin/. Then remove MacRuby itself: /Library/Frameworks/MacRuby.framework." “MacRuby不附带卸载程序。如果要从计算机中删除MacRuby,请删除使用mac前缀并位于/ usr / local / bin /中的MacRuby二进制文件。然后删除MacRuby本身:/ Library /框架/ MacRuby.framework“。

http://ofps.oreilly.com/titles/9781449380373/index.html http://ofps.oreilly.com/titles/9781449380373/index.html

有一个要点做整个卸载: https//gist.github.com/Watson1978/1927952 ,它的工作非常好!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM