我有一个宝石,必须用一些选项来构建.
gem install pg --with-pg-include=/Library/Postgresql/9.0/include/ --with-pg-lib=/Library/Postgresql/9.0/lib/
我可以在Gemfile中包含这些选项吗?在我的Gemfile中,pg命令是
gem "pg","0.12.2"
我想在版本号后面提供一些选项.
谢谢,
晚礼服
解决方法
以下是评论中已发布的链接中的相关文字:
BUILD OPTIONS
You can use
bundle config
to give bundler the flags to pass to the gem installer every time bundler tries to install a particular gem.A very common example,the
MysqL
gem,requires Snow Leopard users to pass configuration flags togem install
to specify where to find theMysqL_config
executable.
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
MysqL
gem,it will pass along the flags you specified.
以下是自定义构建选项的另一个示例,在这种情况下,指定要从rubygems以外的地方下载的特定源:
bundle config build.popen4 –source http://gemcutter.org