Can't install Ruby under Lion with RVM – GCC issues
This answer was edited multiple times and now contains several alternative solutions. Try the simple “Edit 3” solution first.
Ruby 1.9.3-p125 and later have official support for clang, so if you are installing such a version you should not need GCC. If you’re installing an older version of Ruby, read on.
To compile Ruby with GCC, you need a non-LLVM version of GCC, which is no longer included with Xcode 4.2. Install it yourself (or downgrade to Xcode 4.1 temporarily), then do CC=/usr/local/bin/gcc-4.2 rvm install 1.9.3 --enable-shared
(substituting the path to your non-LLVM gcc).
Edit: https://github.com/kennethreitz/osx-gcc-installer/downloads may help for installing GCC. There is also some info available by running rvm requirements
.
Edit 2: For an easier solution, you can try adding --with-gcc=clang
to the arguments to configure
for Ruby to use clang instead of GCC.
Edit 3: rvm install 1.9.3 --with-gcc=clang
does that for you.
Note: With current versions of Xcode you need to install the command-line tools separately from the Xcode menu -> Preferences -> Downloads -> Components. This is a pre-requisite for doing any compiling with Xcode on the command-line, not just Ruby.
Note 2: If something doesn't work after following the steps, try doing a reboot or re-login to ensure that the environment gets set correctly.
Note 3: Ruby versions prior to 1.9.3-p125 may not always be fully compatible with clang, so test your software thoroughly if using the “edit 3” solution in a production environment.
Lion ate my RVM and now I can't install Ruby
After you install Lion, you have to re-install Xcode/Developer tools. It is available from the app store.
http://itunes.apple.com/us/app/id448457090?mt=12
Can't install Ruby 1.9.3 via rvm in OS X Lion even with --with-gcc=clang
This should solve it:
rvm get head
rvm install 1.9.3 --autolibs=4
Can't install Ruby Enterprise Edition with RVM on OSX Lion
I was able to duplicate your error, just now. This solved it for me:
$ rvm remove ree
$ export CC=/usr/bin/gcc-4.2
$ rvm install --force ree
Install Ruby with Mountain Lion, Xcode 4.5, and RVM?
no, ruby is not fully compatible with llvm, there is at least one issue with Fibers and other issues might occur if version of llvm changes.
Ruby works best with gcc-4.2, rvm provides information how to get it (+other important stuff):
rvm requirements
Make error installing Ruby 1.9.2 with RVM and Readline under OSX Lion
I had a very similar issue. I eventually found that adding this to my .bash_profile stopped my initial make errors:
export ARCHFLAGS="-arch x86_64"
Also from the command line run the following:
brew install readline
brew link readline
brew install libxml2
brew link libxml2
Then when you install ruby use this command:
rvm install 1.9.2 -C --with-readline-dir=/usr/local/Cellar/readline/6.2.1/ --with-libxml2-dir=/usr/local/Cellar/xml2/2.7.8
Hope that helps
RVM not able to install different versions of Ruby
Looks like you need to install Xcode Command Line tools, so you can compile RVM on installation. I believe just installing Xcode will do it.
Related Topics
Restarting a Loop from the Top
Find Out If Current Time Is Between Two Times
How to Assign a Variable in an If Else Statment Check
How to Check If a Value Exists in an Array in Ruby
To_D to Always Return 2 Decimals Places in Ruby
Git, Heroku: Pre-Receive Hook Declined
How to Match the Last Occurrence of a Pattern
How to Get the Current Absolute Url in Ruby on Rails
How to Skip the First Line of a CSV File and Make the Second Line the Header
How to Install a Gem or Update Rubygems If It Fails With a Permissions Error
Installed Ruby 1.9.3 With Rvm But Command Line Doesn't Show Ruby -V
What Is the Best Method of Handling Currency/Money
Get the Name of the Currently Executing Method
Getting the Hostname or Ip in Ruby on Rails
Gem Installation Error: You Have to Install Development Tools First (Windows)