Rails: Options for building gemfile

I have a gem that needs to be built with some parameters.

gem install pg --with-pg-include=/Library/PostgreSQL/9.0/include/ --with-pg-lib=/Library/PostgreSQL/9.0/lib/ 

Can I include these options in a gemfile? In my gemfile pg command

 gem "pg", "0.12.2" 

I want to provide some parameters after the version number.

THX, Tux

+8
ruby-on-rails ruby-on-rails-3 gem bundler
source share
1 answer

Here is the relevant text from the link posted in the comments already:

BUILDING OPTIONS

You can use bundle config to pass flags to the package, which are passed to the gem installer every time the provider tries to install a particular stone.

A very common example, mysql gem, requires Snow Leopard users to pass the gem install configuration flags to indicate where to find the mysql_config executable.

 gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config 

Since the specific location of this executable can vary from machine to machine, you can specify these flags for each machine.

 bundle config build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config 

After executing this command, every time the collector needs to install the mysql gem, it will go through the flags you specify.

Here is another example of custom assembly options, in this case, specify a specific source to download from other than rubygems:

bundle config build.popen4 --source http://gemcutter.org

+10
source share

All Articles