Octopress is a great blogging platform for coders. (Full disclosure: This 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.
1 2 |
|
This was a little intriguing, but not hard to fix. However, after trying to run gem install RedCloth, we got another error.
1 2 3 4 5 6 7 |
|
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.
1 2 3 4 5 |
|
Sources:
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