加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-16 19:18:37 所属栏目:百科 来源:网络整理
导读:我有一个宝石,必须用一些选项来构建. 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" 我想在版本号后面提
我有一个宝石,必须用一些选项来构建.
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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读