rvm install ruby​​-1.8.7-p334 给出错误“您传递了 --clang 选项,但 clang 不在您的路径中”

发布于 2024-11-02 18:30:44 字数 293 浏览 5 评论 0原文

尝试在 Mac OS X 10.5.8 上使用 RVM。

> rvm install ruby-1.8.7-p334
ERROR: 
You passed the --clang option and clang is not in your path. 
Please try again or do not use --clang.

我不知道这个错误是什么;查看 RVM 脚本毫无结果。谷歌没有找到这个错误字符串。 1.8.7 位于“rvm 已知列表”中。

有人以前见过这个吗?

Attempting to use RVM on a Mac OS X 10.5.8.

> rvm install ruby-1.8.7-p334
ERROR: 
You passed the --clang option and clang is not in your path. 
Please try again or do not use --clang.

I have little idea what this error is about; looking in the RVM script leads nowhere. No luck on google finding this error string. 1.8.7 is in "rvm list known".

Anyone seen this before?

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

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

发布评论

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

评论(5

浅沫记忆 2024-11-09 18:30:44

我不知道解决方案,但这似乎是一个全新的问题,最近也在邮件列表上报告:

http://groups.google.com/group/rubyversionmanager/browse_thread/thread/228d9cd4cf250f68/ec09c7051c8b6e37?show_docid=ec09c7051c8b6e37

您可以通过安装 clang 来解决此问题:

sudo apt-get install clang

但是,注释中没有提到 clang 是依赖项,因此这可能是错误的结果。

I don't know the solution, but it appears to be a brand new problem that was recently reported on the mailing list as well:

http://groups.google.com/group/rubyversionmanager/browse_thread/thread/228d9cd4cf250f68/ec09c7051c8b6e37?show_docid=ec09c7051c8b6e37

You can work around it by installing clang:

sudo apt-get install clang

But, the notes mention nothing about clang being a dependency, and so this may be a result of a bug.

放肆 2024-11-09 18:30:44

所以,这绝对是最新版本中的一个错误。我的建议(特别是因为您没有使用 Edge Ruby)是恢复到旧版本。

rvm implode
yes

接下来,使用以下命令通过特定的源版本进行安装:

curl -s https://rvm.beginrescueend.com/install/rvm -o rvm-installer ; chmod +x rvm-installer ; ./rvm-installer 1.6.0

注意,我选择了 v1.6.0(目前是 1.6.3)。我遇到了类似的问题,这为我解决了......

So, this is definitely a bug in the latest release. My advice (especially since you're not using edge Ruby) is to revert to an old version.

rvm implode
yes

Next, use the following command to install via a specific source version:

curl -s https://rvm.beginrescueend.com/install/rvm -o rvm-installer ; chmod +x rvm-installer ; ./rvm-installer 1.6.0

Note, I've chosen v1.6.0 (it's currently 1.6.3). I was running into a similar problem, and this fixed it for me...

满身野味 2024-11-09 18:30:44

如果您谈论的是版本 1.6.3,我遇到了同样的问题,并通过在 .rvm/scripts/selector 中注释第 506 行并说 __rvm_default_flags 来安装 ruby​​ 1.9.2

此函数似乎设置了与 clang 相关的错误默认值

In case you're talking about version 1.6.3, I'm experiencing the same problem and got it to install ruby 1.9.2 by commenting line 506 in .rvm/scripts/selector saying __rvm_default_flags

This function seems to set faulty clang-related defaults

笑红尘 2024-11-09 18:30:44

我相信问题是 此提交,特别是对 .rvm/ 的更改脚本/env

编辑 .rvm/scripts/manage 是解决该问题的一种方法(请参阅 flitzwald 的答案另一种方法):(

  20 __rvm_check_for_clang()
  21 {
  22   if [[ "${rvm_clang_flag}" -eq 1 ]] && ! command -v clang >/dev/null ; then  
  23     rvm_error "\nYou passed the --clang option and clang is not in your path. \nPlease try again or do not use --clang.\n"
  24     return 1
  25   fi
  26 }

当您在 .rvm/scripts/cli 中调用时,$rvm_clang_flag 设置为 1。现在错误地触发了错误,因为标志的默认设置和标志的测试不匹配。)

编辑:只是一个后续注释。这是一个错误;它已修复。如果您通过 Google 来到这里,rvm get head && rvm reload 一切都会恢复正常。

I believe the problem is this commit, specifically the changes to .rvm/scripts/env.

Editing .rvm/scripts/manage is one way to fix the problem (see flitzwald's answer for another way to do it):

  20 __rvm_check_for_clang()
  21 {
  22   if [[ "${rvm_clang_flag}" -eq 1 ]] && ! command -v clang >/dev/null ; then  
  23     rvm_error "\nYou passed the --clang option and clang is not in your path. \nPlease try again or do not use --clang.\n"
  24     return 1
  25   fi
  26 }

($rvm_clang_flag is set to 1 when you call for it in .rvm/scripts/cli. The error is being falsely tripped now because the flag's default settings and the test for the flag don't match up.)

Edit: Just a follow-up note. It was a bug; it's been fixed. If you come by here via Google, rvm get head && rvm reload and all should be well again.

泪意 2024-11-09 18:30:44

刚刚尝试了这个 - 问题已经解决了...但是 - 我认为你的意思是编辑脚本/管理,而不是脚本/env ;)

Just tried this - and it's sorted that issue out... BUT - you meant edit scripts/manage, not scripts/env I think ;)

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