Friday, June 07, 2013

Install RedCloth 4.2.7 gem with bundler (using ruby enterprise edition 1.8.7)

Got an error when i have Redcloth 4.2.7 in my Gemfile and try to run 'bundle install'

The error reads -

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/local/ruby/bin/ruby extconf.rb 
checking for main() in -lc... yes
creating Makefile

make
/usr/bin/gcc  -I. -I/opt/local/include -I. -I/usr/local/ruby/lib/ruby/1.8/i686-linux -I. -D_FILE_OFFSET_BITS=64  -fPIC -g -O2   -O0 -Wall -Werror  -c redcloth_scan.c
/usr/bin/gcc  -I. -I/opt/local/include -I. -I/usr/local/ruby/lib/ruby/1.8/i686-linux -I. -D_FILE_OFFSET_BITS=64  -fPIC -g -O2   -O0 -Wall -Werror  -c redcloth_attributes.c
ragel/redcloth_attributes.c.rl: In function ‘redcloth_attribute_parser’:
ragel/redcloth_attributes.c.rl:26:11: error: variable ‘act’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
make: *** [redcloth_attributes.o] Error 1


Gem files will remain installed in /home/uday/.bundler/tmp/6540/gems/RedCloth-4.2.7 for inspection.
Results logged to /home/uday/.bundler/tmp/6540/gems/RedCloth-4.2.7/ext/redcloth_scan/gem_make.out


Fix - 

This can be fixed by adding "--with-cflags=-w" config option to redcloth build.

To do this, just run "bundle config build.RedCloth --with-cflags=-w" from the rails add directory and continue with "bundle install"



Related Posts:

0 comments:

Post a Comment