ruby-on-rails – Rails:构建bundler gemfile的选项

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – Rails:构建bundler gemfile的选项前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个宝石,必须用一些选项来构建.
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 to gem install to specify where to find the MysqL_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

猜你在找的Ruby相关文章