Install Ruby with Mountain Lion, Xcode 4.5, and RVM? - ruby

rvm install 1.9.3 --with-gcc=clang (as suggested by Can't install Ruby under Lion with RVM – GCC issues) doesn't work because neither Mac OS X 10.8.2 (Mountain Lion) nor Xcode 4.5 comes with clang.
Is it possible to compile Ruby with llvm?
According to Matthias Schmidt's "How to install Ruby 1.9.3 on Mac OS X with LLVM and rbenv", Ruby is now fully compatible with LLVM.
But, I still get: error: C compiler cannot create executables
UPDATE:
Actually, I found clang here /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang (thanks to the Node.js Installation Wiki). I just didn't have clang in my path.
So, if I add clang to my path, is rvm install 1.9.3 --with-gcc=clang sufficient?

From RVM notes:
Homebrew:
If you are using Homebrew, you can install the apple-gcc42 and required libraries from homebrew/dupes:
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
rvm pkg install openssl
This can live side by side with an existing Xcode 4.2+ install or Command Line Tools for Xcode.
osx-gcc-installer:
If you don't use Homebrew, you can download and install osx-gcc-installer:
https://github.com/kennethreitz/osx-gcc-installer.
Hope it will help you.

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

I used this: http://railsinstaller.org/mac - and it was a BREEZE. Also I like the sublime text editor, found that through this resource... Maybe I'll say goodbye to macvim! Imagine that.

Related

"No available formula for gcc46" while installing Ruby 1.9.3 on OS X with RVM:

I have Homebrew installed, I'm trying to install RVM with:
rvm install 1.9.3-head
and I get this error:
Installing required packages:gcc46
Error running 'requirements_osx_brew_libs_install gcc46',
please read /Users/mike/.rvm/log/1384918134_ruby-1.9.3-head/package_install_gcc46.log
Requirements installation failed with status: 1
brew doctor says I'm ready to brew.
In the log I see:
Error: Download failed: ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-4.3.2.tar.bz2
Ruby 1.9.3+ supports compiling with Clang (which you do have) instead of GCC, so make RVM compile with Clang instead:
rvm install 1.9.3 --with-gcc=clang
When I upgraded to mavericks from mountain lion it somehow started ignoring my dev-tools (like gcc, etc.) try
xcode-select --install
also see here
When upgraded to OSX 10.12 and installing ruby 2.3.1 these steps fixed the issue.
brew install homebrew/versions/gcc46
if there are any linking issues related to any lib please follow the instructions for example
brew link --overwrite libtool
brew link --overwrite libgpg-error
Once the installation of gcc46 is successful you could
rvm install 2.3.1

RVM requirements error

I have OS X Mavericks installed and I'm trying to run rvm requirements in terminal and it gives me this error.
Installing required packages: autoconf, automake, libtool, pkgconfig, libyaml, libffi, readline, libksba, curl-ca-bundle, gdbm.............
Error running 'requirements_osx_port_libs_install autoconf automake libtool pkgconfig libyaml libffi readline libksba curl-ca-bundle gdbm',
please read /Users/Alex/.rvm/log/ruby-1.9.3-p448/1374263757_package_install_autoconf_automake_libtool_pkgconfig_libyaml_libffi_readline_libksba_curl-ca-bundle_gdbm.log
Requirements installation failed with status: 1.
It looks like RVM tried to install some dependencies using Macports and Macports proceeded to get really confused about dependencies when it tried to install autoconf.
Try running:
brew install autoconf
Otherwise you should run this bash script:
https://gist.github.com/siraj/1399288
Assuming you have brew, which you should if you don't.
If your Macports just isn't working, then you can manually install all of the requirements like this:
brew install autoconf automake libtool pkgconfig libyaml libffi readline libksba curl-ca-bundle gdbm
I tried the above, and a few other things. None worked.
It seems that on OSX 10.9 and XCode5 moved some libs around on us. So I had to install XCode5-DP6 (Dev Preview 6), opened up DP6 and in the settings, you have to tell the command line tools to use the new DP6 build and not the Standard XCode from the marketplace.
First, I had to install homebrew. Nothing liked to play with macports. I am on my first mac as of only a month ago, so macports was just what solved apache for me at the time. I then had to run 'brew install autoconf'
Once I did that I then ran rvm requirements, everything installed without issue. then sudo gem install jekyll from there and it all works like a charm now.
I'm sure once Mavericks is actually released this will get ironed out. We are using early releases after all...
Hope this works for you guys.

Ruby on Rails install trouble on OSX with dependencies

I'm trying to install RoR on Mountain Lion. I have the following installed:
Xcode from the App Store with command line tools
RVM
homebrew
In terminal I verified that gcc is installed.
When I type in "rvm requirements" I get a message saying that I'm missing a number of dependencies including OpenSSL, autoconf, automake, libxslt and many more. RVM also says to install these with brew. So I do and rvm no longer complains about the missing dependencies.
But when I try to install ruby 1.9.3 via "rvm install 1.9.3", at the end of the compile I receive a message "ruby was built using clang -but it's not (fully) supported, expect errors."
I'm stumped at this point. I'm trying to figure out:
Why are dependencies missing when I've installed Xcode command line tools?
Why am I still getting a compile error after using brew to install the dependencies?
Help please. :)
Try using gcc compiler instead i.e
rvm install 1.9.3 --with-gcc-4.2
Reference: https://github.com/wayneeseguin/rvm/issues/1480
So here's the order I usually go through before installing any Rubies.
1st thing: Install XCode and the Command Line Tools for Mountain Lion (you can also install these from the Preferences > Downloads window).
2nd: Make sure you have Homebrew installed.
3rd: Once that's set up, run brew tap homebrew/dupes
4th: Then brew install openssl autoconf apple-gcc42 automake
I had issues with RVM and have long since switched to RBenv/Ruby-Build. There are various differences, but really running through the above steps should fix any issues you had, and lots of people use one or the other. Both are great.
Then, just try to install Ruby however you choose to.

How can I install Ruby 1.9.3 in Mac OS X Mountain Lion without Xcode?

I would like to know about alternative ways to build a development machine for Ruby 1.9.3 on OS X 10.8 Mountain Lion, that does not require Xcode.
Mountain Lion is now Golden Master as I'm writing this question, so it could be considered as final version. That cannot be said about Xcode, that is a preview release yet.
RVM recommends to install osx-gcc-installer over Xcode, but I would like not to mess my system.
What is the cleanest way to install Ruby 1.9.3 on Mountain Lion without Xcode?
osx-gcc-installer turns out to be a very good option to replace Xcode in order to install Ruby 1.9.3
These are the steps I have followed:
Download & install the latest version of osx-gcc-installer here (GCC-10.7-v2 is fine): https://github.com/kennethreitz/osx-gcc-installer
Install RVM as usual and select 1.9.3-head as the default ruby installation: https://rvm.io/rvm/install/
Install Homebrew: https://github.com/mxcl/homebrew/wiki/installation
Install libksba to resolve some dependencies with Ruby 1.9.3: brew install libksba
That's it! You should now have Ruby 1.9.3 installed on Mountain Lion working perfectly.
If you need some other packages, install them now through Homebrew, such as Imagemagick for example: brew install imagemagick
It's possible that you need XQuartz for Homebrew to work properly, as Apple is not shipping X11 since Mountain Lion. You can download it here: http://xquartz.macosforge.org/trac/wiki
EDIT:
Now (since 29th July) Command line tools for Xcode 4.4 are available.
So, the new steps are these:
Download & install Command line tools for Xcode 4.4 (you don't need to download Xcode): https://developer.apple.com/downloads/index.action
Install Homebrew: https://github.com/mxcl/homebrew/wiki/installation
Install automake: brew install automake
Install RVM as usual and select 1.9.3-head as the default ruby installation: https://rvm.io/rvm/install/
Optional step: You may need XQuartz for some components, for example for Imagemagick, so download & install XQuartz: http://xquartz.macosforge.org/trac/wiki
I also had to add this:
export CC=/usr/bin/gcc-4.2
in order to make the Apple command line tools work with the rvm. Without this I had repeated llvm issues:
The provided CC(gcc) is LLVM based, it is not yet fully supported by ruby and gems, please read rvm requirements.
I had to add
export CPPFLAGS=-I/opt/X11/include
as well as
export CC=/usr/local/bin/gcc-4.2
I was still getting compilation errors due to readline (things like readline.c: In function ‘readline_s_vi_editing_mode_p’: in the make.log file), and the RVM readline page didn't seem to help, so I ran
brew install readline
followed by
rvm install 1.9.3 -C --with-readline-dir=/usr/local/Cellar/readline/6.2.4

Error compiling ruby 1.9.3 using rvm, homebrew, or macports

I've tried installing ruby 1.9.3 using rvm, using homebrew, and using macports and all seem to fail part way through the compile. I'm using Lion OSX.
Here is the log file of my most recent attempt using rvm
http://pastebin.com/AEiJbGzD
Any help would be appreciated. It all started when I started getting openssl errors so tried uninstalling openssl and re-installing it. Openssl installed with no issue but then I couldn't get ruby re-installed.
Thanks
I was able to install Ruby 1.9.3 on Lion and Xcode 4.2 using rvm with the --with-gcc=clang flag:
$ rvm install 1.9.3 --with-gcc=clang
You should install OSX GCC installer:
GitHub - OSX GCC Installer
After installation you run:
CC=/usr/bin/gcc-4.2 rvm install 1.9.3
And it should work.
Or you can change permanently:
export CC=/usr/bin/gcc-4.2
rvm install 1.9.3
Xcode 4.2 doesn't install non-LLVM gcc anymore.
I have had this problem after reinstall mountain lion (clean install) and after install XCode 5 DP... I have followed the steps and installed Command Line Tools from Xcode/Preferences... and had having the same problem.
I have been checking https://developer.apple.com/downloads/index.action?=command%20line%20tools and installed "Command Line Tools (OS X Mountain Lion) for Xcode - April 2013" after that, everything works fine.
Regards

Resources