For gherkin it seems I need to do this:
gem install gherkin -- --with-cflags="-std=c99"
Yet, in bundler it's not obvious how to pass these along. You can't do it in the Gemfile -- and you might not want to since another machine could have a different environment.
To pass these flags you create a configuration for the build, which is stored in your machines config only.
From Bundler Gemfile docs:
You can use
bundle configto give bundler the flags to pass to the gem installer every time bundler tries to install a particular gem.
A very common example, the
mysqlgem, requires Snow Leopard users to pass configuration flags to
gem installto specify where to find the
gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Since the specific location of that executable can change from machine to machine, you can specify these flags on a per-machine basis.
bundle config build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config
After running this command, every time bundler needs to install the
mysqlgem, it will pass along the flags you specified.
First spotted here: