Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control bundle config through pkgr? #60

Closed
mdr opened this issue Apr 27, 2015 · 6 comments
Closed

Control bundle config through pkgr? #60

mdr opened this issue Apr 27, 2015 · 6 comments

Comments

@mdr
Copy link

mdr commented Apr 27, 2015

I'm trying to package my Rails app that depends on nokogiri. Apparently Bundler needs special configuration to build on my Ubuntu 14.04 VM:

bundle config build.nokogiri "--use-system-libraries --with-xml2-include=/usr/include/libxml2"

Can I control that through pkgr? Otherwise it fails:

$ pkgr package simple-merchant/
-----> Ruby app
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using 1.7.12
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j2 --deployment
Fetching gem metadata from https://rubygems.org/.........
Installing rake 10.4.2
Installing i18n 0.7.0
Installing json 1.8.2
Installing minitest 5.5.1
Installing thread_safe 0.3.5
Installing tzinfo 1.2.2
Installing activesupport 4.2.1
Installing builder 3.2.2
Installing erubis 2.7.0
Installing mini_portile 0.6.2
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/tmp/d20150427-20456-8lhcav/opt/simple-merchant/vendor/ruby-2.0.0/bin/ruby extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using system libraries.
libxml2 version 2.6.21 or later is required!
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

@luizsignorelli
Copy link
Contributor

Hello,

I was able to do this using bundler's --local option. This option writes the config in the app directory so pkgr will have access to it.

Try this:

bundle config --local build.nokogiri "--use-system-libraries --with-xml2-include=/usr/include/libxml2"

@mdr
Copy link
Author

mdr commented Apr 27, 2015

Thanks, that works a treat!

@mdr mdr closed this as completed Apr 27, 2015
@crohr
Copy link
Owner

crohr commented Apr 27, 2015

Thanks for the tip @luizsignorelli !

@crohr crohr mentioned this issue May 12, 2015
@andyjeffries
Copy link

Was there any way of controlling this through .pkgr.yml? The problem is that running that on my Debian build server doesn't make any difference - I get the same error. And if I set it in the repository, it'll affect my OS X development machine.

@andyjeffries
Copy link

Even leaving out the --local when running the bundle config command on the build machine doesn't work (I don't know if anyone would expect it to).

@crohr
Copy link
Owner

crohr commented Sep 16, 2015

@andyjeffries I suppose you could run that command as a before step in the .pkgr.yml file, so that it gets run on the build machine?

before:
  - bundle config --local build.nokogiri "--use-system-libraries --with-xml2-include=/usr/include/libxml2"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants