{"id":783,"date":"2012-06-12T07:14:21","date_gmt":"2012-06-12T15:14:21","guid":{"rendered":"https:\/\/accretiondisc.com\/blog\/?p=783"},"modified":"2012-06-11T17:11:57","modified_gmt":"2012-06-12T01:11:57","slug":"ruby-and-mac-os-x-lion","status":"publish","type":"post","link":"https:\/\/accretiondisc.com\/blog\/2012\/06\/12\/ruby-and-mac-os-x-lion\/","title":{"rendered":"Ruby and Mac OS X Lion"},"content":{"rendered":"<p>When Apple switched from <a href=\"http:\/\/gcc.gnu.org\/\">GCC<\/a> to <a href=\"http:\/\/clang.llvm.org\/\">LLVM<\/a> in <a href=\"https:\/\/developer.apple.com\/xcode\/\">Xcode 4.2<\/a>, they made it significantly more difficult for me to run <a href=\"http:\/\/www.ruby-lang.org\/en\/\">ruby<\/a> 1.9.2. (What are the odds this will get easier with <a href=\"http:\/\/www.apple.com\/osx\/\">Mountain Lion<\/a>?)<\/p>\n<p>I was using <a href=\"https:\/\/github.com\/sstephenson\/rbenv\">rbenv<\/a> and its <a href=\"https:\/\/github.com\/sstephenson\/ruby-build\">rbenv-build<\/a> plugin to install ruby 1.9.2 and it told me this:<\/p>\n<blockquote>\n<pre>$ rbenv install 1.9.2-p320\r\n\r\nERROR: This package must be compiled with GCC, but ruby-build couldn't\r\nfind a suitable `gcc` executable on your system. Please install GCC\r\nand try again.\r\n\r\nDETAILS: Apple no longer includes the official GCC compiler with Xcode\r\nas of version 4.2. Instead, the `gcc` executable is a symlink to\r\n`llvm-gcc`, a modified version of GCC which outputs LLVM bytecode.\r\n\r\nFor most programs the `llvm-gcc` compiler works fine. However,\r\nversions of Ruby older than 1.9.3-p125 are incompatible with\r\n`llvm-gcc`. To build older versions of Ruby you must have the official\r\nGCC compiler installed on your system.\r\n\r\nTO FIX THE PROBLEM: Install the official GCC compiler using these\r\npackages: https:\/\/github.com\/kennethreitz\/osx-gcc-installer\/downloads\r\n\r\nYou will need to install the official GCC compiler to build older\r\nversions of Ruby even if you have installed Apple's Command Line Tools\r\nfor Xcode package. The Command Line Tools for Xcode package only\r\nincludes `llvm-gcc`.\r\n<\/pre>\n<\/blockquote>\n<p>Note: when you install that, it doesn&#8217;t (appear to) provide an uninstaller. Instead it says this:<\/p>\n<blockquote><p>If something doesn&#8217;t work as expected, feel free to install Xcode over this installation.<\/p>\n<p>Once installed, you can remove Xcode completely with the following:<\/p>\n<pre>\r\nsudo \/Developer\/Library\/uninstall-devtools \u00e2\u20ac\u201cmode=all\r\n<\/pre>\n<\/blockquote>\n<p>Bummer for me, huh? Mercifully, the GCC installation package doesn&#8217;t mess up the llvm-gcc link in <code>\/usr\/bin\/gcc<\/code>. But that means when I do the ruby build, I need to add:<\/p>\n<blockquote>\n<pre>\r\nexport CC=\/usr\/bin\/gcc-4.2\r\n<\/pre>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>When Apple switched from GCC to LLVM in Xcode 4.2, they made it significantly more difficult for me to run ruby 1.9.2. (What are the odds this will get easier with Mountain Lion?) I was using rbenv and its rbenv-build plugin to install ruby 1.9.2 and it told me this: $ rbenv install 1.9.2-p320 ERROR: [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[52],"tags":[553,554,551,552,96,555,200,556],"class_list":["post-783","post","type-post","status-publish","format-standard","hentry","category-technology","tag-clang","tag-gcc","tag-lion","tag-llvm","tag-mac-2","tag-rbenv","tag-ruby-2","tag-xcode"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paRqpr-cD","_links":{"self":[{"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/posts\/783","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/comments?post=783"}],"version-history":[{"count":0,"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/posts\/783\/revisions"}],"wp:attachment":[{"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/media?parent=783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/categories?post=783"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/tags?post=783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}