通过 macports 安装 ruby​​ 没有任何进展。这个行动需要多长时间?

发布于 2024-10-24 23:01:03 字数 417 浏览 7 评论 0原文

我正在使用 macports 安装 ruby​​。我在终端中输入以下命令:

sudo port install ruby

终端通过返回一些指示操作正在运行的行进行响应,然后它停止返回任何新行。我输入:

which ruby

并没有得到响应,所以我关闭了终端窗口并最终结束了进程。

我打开了一个新的终端窗口并重新输入了原始安装命令,现在我收到以下消息:

Waiting for lock on /opt/local/var/macports/registry/.registry.lock

我应该如何从这里继续?我应该等待吗?如果是这样,需要多长时间?终端会尝试完成此操作两次吗?我怎么知道它是否有效?

I'm in the process of installing ruby using macports. I typed the following command into terminal:

sudo port install ruby

Terminal responded by returning some lines that indicated the action was working, then it just stopped returning any new lines. I typed:

which ruby

and didnt get a response, so I closed the terminal window and consequently ended the processes.

I opened a new terminal window and re-typed the original install command and now I get the following message:

Waiting for lock on /opt/local/var/macports/registry/.registry.lock

How should I proceed from here? Should I just wait? If so, how long? Will terminal try to complete this action twice? How can I know if it's working?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

緦唸λ蓇 2024-10-31 23:01:03

当您没有看到任何进展时,更合适的检查是系统的活动。

在 Mac OS 上,您可以打开“活动监视器”并按 CPU 排序,或者打开终端并输入 top -o cpu。留意某些显示一致活动的应用程序,尤其是名称中带有“端口”的应用程序。

要处理锁定...可能性非常大,因为您通过关闭终端将其从膝盖处切断,因此它已经过时了,因此请使用 sudo rm /opt/local/var/macports/registry/.registry.lock< /code> 将其删除并根据需要重试。

我会推荐 RVM 来安装新版本的 Ruby。真的很方便。在进入 RVM 之前,请完整阅读“安装”和“Rubygems”页面,在安装 RVM 后,输入 rvm Notes 并按照它给出的说明进行操作。

最后,在任何情况下,无论这个想法看起来多么好,都不要尝试更换或升级Apple安装的Ruby系统版本。苹果公司安装它是为了自己使用,弄乱它会招来坏juju。

A more appropriate thing to check, when you've seen no progress, is your system's activity.

On Mac OS, you could either open "Activity Monitor" and sort by CPU, or open a terminal and type top -o cpu. Watch for some app showing consistent activity, especially something with "port" in the name.

To deal with the lock... odds are REALLY good it's stale since you cut it off at the knees by closing the terminal, so use sudo rm /opt/local/var/macports/registry/.registry.lock to remove it and retry if you want.

I will recommend RVM for installing new versions of Ruby. It's really convenient. Before you jump into RVM read the "Installation" and "Rubygems" pages entirely, and after installing RVM type rvm notes and follow the directions it spits out.

Finally, do not, under any circumstance, no matter how good an idea it seems to be, try to replace or upgrade the system version of Ruby installed by Apple. Apple installed it for their own use, and messing with it invites bad juju.

送舟行 2024-10-31 23:01:03

等待 /opt/local/var/macports/registry/.registry.lock 上的锁定”表示 MacPorts 已经在运行并正在执行操作。您可以在活动监视器中检查任何正在运行的“端口”进程。等到这些任务完成(如果您不关心它们是否完成,则终止它们),然后再尝试使用 MacPorts 执行其他操作。

ps -A | ps -A | ps -A | ps -A | grep tclsh 如果你找不到正在运行的进程,那么你可以杀死它。

"Waiting for lock on /opt/local/var/macports/registry/.registry.lock" means MacPorts is already running and doing things. You could check for any running "port" processes in Activity Monitor. Wait until these tasks are finished (or terminate them if you don't care that they don't finish) before trying to do other things with MacPorts.

ps -A | grep tclsh if you can't find the running process so you can kill it.

耳钉梦 2024-10-31 23:01:03

安装 Ruby 的最新方法是通过 RVM。不是直接回答你的问题,但我强烈推荐它。

A more recent way to install Ruby is via RVM. Not a direct answer to you question, but I would highly recommend it.

因为看清所以看轻 2024-10-31 23:01:03

这是对rvm的另一次投票。如果您像我一样,在 Mac 上编程,但部署到其他 *nix,那么您可以使用 rvm 的 gemsets 确保每个设备上都有相同版本的 Ruby(以及 Rails 和 gems)。

另外,您可以轻松地在 gemset 之间切换,这样,如果您发现某个 gem 无法在 Ruby 1.9.2 上正常工作,那么您可以在尝试解决问题时切换到 1.8.7 或类似版本。诸如此类的事情。

就我而言,您可以直接在 Mac 上使用 rvm install 1.8.7 或 rvm install 1.9.2(就像您自己一样,不使用 sudo)。然后确保您切换到使用正确的 rvm,并将您想要的 rvm 设置为默认值,这样就万事大吉了。如果它不起作用,请将其删除 - 所有 gemset 都将安装在 .rvm/* 中的主目录下

当您尝试让 Mac 的系统版本的 ruby​​ 与所有东西一起工作时,您现在所经历的痛苦将再次出现你写的——RVM 肯定比使用 Mac 的 Ruby 更容易。

Here is another vote for rvm. If you are like me, and you program on a mac, but you deploy to some other *nix, then you can make sure you have the same version of Ruby (and Rails, and gems) on each, using rvm's gemsets.

Also, you can switch among gemsets easily, so that if you find a gem that you can't get working right with Ruby 1.9.2, then you can switch to 1.8.7 or some such whilst you try to figure it out. Stuff like that.

As far as I'm concerned, you can jump right in on your mac (as yourself, not using sudo) with rvm install 1.8.7 or rvm install 1.9.2. Then make sure you switch to use the correct rvm, and make the one you want your default, and you're golden. If it doesn't work, delete it - all the gemsets will be installed below your home directory in .rvm/*

The pain you are going through now will resurface when you try to keep your system version of Mac's ruby working with all the stuff you write -- RVM is definitely easier than using Mac's Ruby.

岁月静好 2024-10-31 23:01:03

除了铁皮人提到的之外,如果开始出现其他“锁定”错误,我发现暂时禁用互联网连接有助于停止所有正在发生的端口进程。

In addition to what the Tin Man mentioned, if other "lock" errors start coming up, I found disabling the internet connection for a moment was helpful to stop all port processes that were occurring.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文