I encountered the issue previously with rbenv [0]. Even if it builds correctly with clang various tests subsequenty fail, although they appear to pass on ruby trunk.
So for now, one should rather install gcc via the installer, which also allows to build older versions of ruby if need be.
rvm install 1.9.3 --with-gcc=clangRemember that after downloading Xcode form App Store you actually have to INSTALL it and after RUN IT at least once so everything works properly.
For what it's worth, there are a ton of recommendations to do this same thing out there--and for many people it's just not a viable option. This isn't a success story so much as it's using a workaround. Not being part of either the Ruby or Apple dev teams, I won't say whose side this is on to fix: only that it needs to be fixed.
https://bugs.ruby-lang.org/issues/5883
In short: We'd like to support it, but sometimes clang still breaks. So there is no support.
rbenv install 1.9.3-p0
rbenv global 1.9.3-p0
Done.And by "hard" I don't mean "hard for end-users", although it's quite a lot of hoops to jump through for someone who just wants to get up to speed with the current state of the art. I mean the amount of work that has gone into things like RVM and Bundler and other tools to make developing serious software in Ruby possible.
In fact, I'm not sure a much better approach exists for an environment like ruby. .NET issues patches all the time that magically show up and hopefully don't break things. You don't get side-by-side patch releases. The JVM does have patch releases, and it comes with environment problems similar to ruby. They're often transferred to dev tool users in the form of the JAVA_HOME environment variable.
It seems like the core issues that separate ruby from java come from the existence of rubygems and the fact that it likes to install things globally. So in this way, bundler could be a better solution to the problem that rvm/rbenv solve.
Getting any form of Rails installed was a massive pain in the neck. Between GCC issues and architecture issues involving sqlite3 (for some reason), it must have taken over 12 hours of tinkering before I could even start the rails guide.
Nearly gave up on Ruby/Rails many times out of frustration. Glad I stuck it out though.