开发者

rvm install ruby-1.8.7-p334 gives error "You passed the --clang option and clang is not in your path"

开发者 https://www.devze.com 2023-02-28 06:37 出处:网络
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.

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?


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.


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...


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


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消