The following is a guest post by Corinna Brock and originally appeared on her blog. Corinna is currently a student a The Flatiron School. You can learn more about her here, or follow her on twitter here.
Octopress is a great blogging platform for coders. (Full disclosure: My personal blog is run on Octopress.) However, when installing, sometimes strange errors come up. A few weeks ago while setting up our blogs, my classmate Jenya ran into a strange RedCloth error while running bundle install following the otherwise very comprehensive setup instructions provided by Octopress.
This was a little intriguing, but not hard to fix. However, after trying to run gem install RedCloth, we got another error.
Since gem install had never failed for me when I ran it, I decided to do a little more research. What actually is RedCloth? Why do we need it?
RedCloth is a module for using the Textile markup language in Ruby. Even the official website said the gem install should work. The issue was not actually RedCloth, but it turns out after checking the mkmf.log it was an issue with gcc-4.2 also not being found.
gcc is the Gnu Compiler Collection. It includes support for multiple programming languages, as well as libraries for these languages. Even after making sure that command line tools were installed with Xcode, it still didn’t find the gcc compiler. It appears that the newest version of Xcode has removed gcc in favor of clang.
Luckily, she actually had gcc on her machine, but it wasn’t installed. We only needed to run the last two lines of code. If you don’t, run all five lines.
https://github.com/imathis/octopress/issues/59 http://jfire.io/blog/2012/03/02/xcode-4-dot-3-homebrew-and-ruby/ http://stackoverflow.com/questions/12119138/failed-to-build-gem-native-extension-when-install-redcloth-4-2-9-install-linux http://jgarber.lighthouseapp.com/projects/13054/tickets/215-native-ext-compilation-failure