Here is the error message:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
Gem files will remain installed in /var/www/app_dir/shared/bundle/ruby/1.8/gems/bson_ext-1.7.0 for inspection.
Results logged to /var/www/app_dir/shared/bundle/ruby/1.8/gems/bson_ext-1.7.0/ext/cbson/gem_make.out
An error occured while installing bson_ext (1.7.0), and Bundler cannot continue.
Make sure that `gem install bson_ext -v '1.7.0'` succeeds before bundling.
I tried running gem install bson_ext -v '1.7.0'
and this succeeded with no errors. I've tried installing ruby-dev
and ruby1.8-dev
apt packages and this did not help.
bundle install
is able to successfully build bson_ext
on my Mac OS X development system but is failing in the Linux production environment even when I run it directly outside of the context of the capistrano
bundle:install
task.
I have also tried running gem update --system
and gem update bundler
and this didn't help.
I suspect the issue lies in how bundle install
is called on the target system. Still, I tried updating Capistrano to version 2.13.5 and this did not help.
So, it appears that bundler
1.2.1 is is unable to build the following gems on my system:
bson_ext
1.7.0curb
0.8.3nokogiri
1.5.5json
1.7.5therubyracer
0.8.2.I was able to build these using gem install <GEMNAME> -v '<VERSION>' --install-dir /var/www/<APP_DIR>/shared/bundle/ruby/1.8/
. After this, running bundle exec capistrano deploy
succeeded.
bundle
does not appear to be able to build gems with native extensions on my system. Not sure why, but maybe this procedure will help those with a similar issue.