Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to build gem native extension when install RedCloth-4.2.9 install Linux

I want to install Octopress in my computer. I try to do it like

Octopress document.

When I run

bundle install

I got error message

An error occured while installing RedCloth (4.2.9), and Bundler cannot continue.
Make sure that `gem install RedCloth -v '4.2.9'` succeeds before bundling.

So, I run

sudo gem install RedCloth -v '4.2.9'

then, I got a error message again:

ERROR:  Error installing RedCloth:
ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.9.1 extconf.rb
    /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:1:in `<main>'

I hadn't learn any knowledge about ruby.

like image 698
thlgood Avatar asked Aug 25 '12 04:08

thlgood


2 Answers

My ubuntu 12.04 solution is install the ruby1.9.1-full version, that can resolve this issue.

sudo apt-get install ruby1.9.1-full

you can execute command:

sudo update-alternatives --config ruby

to select the altiernative ruby which you have installed. and then, execute below commands to finish the octopress deploy:

git clone https://github.com/erizhang/octopress.git octopress
cd octopress/
sudo gem install bundler
sudo gem install RedCloth -v '4.2.9'
bundle install
rake install

below commands you can find from octopress deploy guideline page:

rake setup_github_pages
sudo rake setup_github_pages
sudo rake generate
sudo rake deploy

Hope it's helpful for you, thanks

like image 172
Eric Zhang Avatar answered Oct 20 '22 05:10

Eric Zhang


I was installing Octopress too and got the same problem as yours. After checking the mkmf.log file I figured out that gcc-4.2 had not been found. I Even installed xcode with the command line tools. It worked when I made a symlink like this:

$ sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
$ bundle install
like image 20
sniperbat Avatar answered Oct 20 '22 05:10

sniperbat