Read more

Gherkin: Error during installation

Andreas Robecke
March 05, 2012Software engineer

When trying to install the gherkin gem, you might encounter an error with the following lines:

ERROR:  Error installing gherkin:
	ERROR: Failed to build gem native extension.
...
checking for main() in -lc... yes
creating Makefile
...
cc1: all warnings being treated as errors
Makefile:150: recipe for target 'gherkin_lexer_ar.o' failed
make: *** [gherkin_lexer_ar.o] Error 1
...
Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

If upgrading is not an option, configure build options for gherkin:

bundle config --local build.gherkin --with-cflags=-w

Your .bundle/config file should now look like this:

---
BUNDLE_BUILD__GHERKIN: "--with-cflags=-w"

You should now be able to install the gem with bundle install.

Make sure to commit and push .bundle/config so your fellow developers (and all the servers you will deploy to) will benefit from this setting.

Posted by Andreas Robecke to makandra dev (2012-03-05 13:47)