gpt4 book ai didi

ruby-on-rails - Rails : Options for build bundler gemfile

转载 作者:行者123 更新时间:2023-12-03 09:26:44 25 4
gpt4 key购买 nike

我有一个 gem ,必须用一些选择来制造。

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-on-rails - Rails : Options for build bundler gemfile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9166146/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com