capistrano failed to build gem native extensions
I'm using a bitnami ruby stack appliance, and trying to set up capistrano
to deploy my app from my MS windows laptop to the appliance. During the
bundle install portion the deployment fails when native extensions can't
be built. This happens for nokogiri and pg gems so far.
For example:
* ©[33mexecuting "cd /opt/bitnami/projects/melvin/releases/20130826221225
&& bundle
install --gemfile
/opt/bitnami/projects/melvin/releases/20130826221225/Gemfile --path
/opt/bitnami/projects/melvin/shared/bundle --deployment --quiet --without
development
test"©[0m
produces:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native
extension.
/opt/bitnami/ruby/bin/ruby extconf.rb
--with-pg-config=/usr/pgsql-9.2/bin/pg_config
Using config values from /usr/pgsql-9.2/bin/pg_config
sh: 1: /usr/pgsql-9.2/bin/pg_config: not found
sh: 1: /usr/pgsql-9.2/bin/pg_config: not found
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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.
But if I open a terminal and ssh in, and issue gem install pg -v '0.16.0'
it works fine.
So what is different about what I'm doing from the ssh terminal, and what
capistrano is doing (presumably from the same ssh connection)?
I've edited the PATH in my .bashrc to use the same PATH as in the bitnami
console.
Anyone ever used capistrano to deploy to a bitnami ruby stack appliance
(ubuntu 12.04 I think)?
UPDATE ---
I just tried cap deploy -d and aborted the deploy just before it rm's the
release directory. Then I used my ssh terminal and went to the release
directory and issued "sudo bundle install" which also gave the error
above. So maybe it's not a difference between capistrano and manual ssh,
but it must be something in the release directory, since "sudo gem install
'pg'" works, which doesn't matter which directory I'm in.
Also, because I can get the gem to install means the necessary libraries,
etc. are installed on my machine somewhere - but bundler seems to have
trouble accessing them.
So I'm thinking this is a bundler issue not a capistrano issue, maybe?
No comments:
Post a Comment