开发者

RoR: Bundler: How do I set up a gem in my gemfile with build options?

standard is this:

gem "mysql", "2.7"

but.. when I install this gem in the t开发者_StackOverflowerminal, I have to run this command:

 export ARCHFLAGS="-arch x86_64" ; sudo gem install --no-rdoc --no-ri mysql -v 2.7 -- --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/mysql/bin/mysql_config


It's only part of the answer but it should at least get you part of the way:

bundle config build.mysql --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/mysql/bin/mysql_config --no-rdoc --no-ri

This will create .bundle/config in your home directory, with the build options saved for the next time you're bundl'ing install.

For the second part (setting the environment variable), you could either export the variable somewhere where it would get set up permanently (eg. in your .bashrc) or always run the command this way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜