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

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...