Posts tagged with RedCloth

RedCloth gem in Oneiric alpha

Cedric 19/07/2011 17:58 ubuntu gem RedCloth oneiric 0 comments

By default Ubuntu 11.10 wil come with gcc 4.6. When trying to install the RedCloth gem, the following error comes:

ragel/redcloth_inline.c.rl: In function ‘red_block’:
ragel/redcloth_inline.c.rl:99:9: error: variable ‘attr_regs’ set but not
used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

The problem is that gcc is considering warning as errors and the gem will not compile.

To avoid this you can install gcc 4.5, install the gem and reinstall gcc 4.6 as default compiler.

First check what is your gcc:

ls -al /usr/bin/gcc
lrwxrwxrwx 1 root root 16 2011-07-19 16:15 /usr/bin/gcc -> /usr/bin/gcc-4.6

then we remove the link with

sudo rm /usr/bin/gcc

then install gcc-4.5

sudo apt-get install gcc-4.5

and link gcc to the gcc-4.5

sudo ln -s /usr/bin/gcc-4.5 /usr/bin/gcc

Now install the gem:

sudo gem install RedCloth

After this unlink gcc-4.5 and relink to gcc-4.6

sudo rm /usr/bin/gcc
sudo ln -s /usr/bin/gcc-4.6 /usr/bin/gcc

That should work like a charm