0

In a rails project, I have a Gemfile which specifies a gem dependency as follows:

gem 'darshan', '1.1.4'

To be compiled, this particular gem requires the location of the corresponding C library, which may not be in a "standard" location such as /usr/lib. Manually, one would install this gem as follows, for example:

gem install darshan -- --with-darshan-dir=$HOME/local

How can I add this "with-darshan-dir..." to the gem command in the Gemfile, and more importantly, how can I make it such that the user himself provides this location as optional parameter when calling bundle install?

I checked the gemfiles manual (http://bundler.io/man/gemfile.5.html) but couldn't find anything to do that.

Thanks

sunmat
  • 6,976
  • 3
  • 28
  • 44
  • I think this is what you need: http://stackoverflow.com/questions/5167829/how-can-i-pass-a-parameter-for-gem-installation-when-i-run-bundle-install. In your case you probably need to use `build.darshan` as the option. – matt Oct 16 '14 at 12:10
  • Works like a charm! Thanks, can you make it as an answer so that I can validate it? EDIT: in this particular case, the command was bundle config build.darshan --with-darshan-dir=$HOME/local – sunmat Oct 16 '14 at 12:28

0 Answers0