Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

rvm

clang

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?

like image 449
noogrub Avatar asked Apr 21 '11 03:04

noogrub


4 Answers

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.

like image 123
travis-146 Avatar answered Oct 12 '22 06:10

travis-146


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

like image 32
sethvargo Avatar answered Oct 12 '22 05:10

sethvargo


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

like image 44
flitzwald Avatar answered Oct 12 '22 05:10

flitzwald


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.

like image 22
Telemachus Avatar answered Oct 12 '22 07:10

Telemachus