Getting the following error on bundle install during deployment with capistrano3
I have atomic gem in my Gemfile.lock with the specific version it asks me to install.
atomic (1.1.16) and having manually installed in my ec2 machine too. But during deployment it repeatedly says the following.
$cap development deploy
INFO [44c32ab1] Running ~/.rvm/bin/rvm default do bundle install --binstubs /home/ec2-user/apps/dev/shared/bin --path /home/ec2-user/apps/dev/shared/bundle --without development test --deployment --quiet on 54.201.16.12
DEBUG [44c32ab1] Command: cd /home/ec2-user/apps/dev/releases/20140423071010 && ~/.rvm/bin/rvm default do bundle install --binstubs /home/ec2-user/apps/dev/shared/bin --path /home/ec2-user/apps/ybench_dev/shared/bundle --without development test --deployment --quiet
DEBUG [44c32ab1] Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
DEBUG [44c32ab1]
DEBUG [44c32ab1] /home/ec2-user/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb
DEBUG [44c32ab1] Cannot allocate memory - /home/ec2-user/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb 2>&1
DEBUG [44c32ab1]
DEBUG [44c32ab1] Gem files will remain installed in /home/ec2-user/apps/dev/shared/bundle/ruby/2.1.0/gems/atomic-1.1.16 for inspection.
DEBUG [44c32ab1] Results logged to /home/ec2-user/apps/dev/shared/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0/atomic-1.1.16/gem_make.out
DEBUG [44c32ab1] An error occurred while installing atomic (1.1.16), and Bundler cannot continue.
DEBUG [44c32ab1] Make sure that `gem install atomic -v '1.1.16'` succeeds before bundling.
cap aborted!
Try this.
https://github.com/classmethod-aws/ec2-swap
ec2-swap: create and swapon swap image on EC2 instance store ec2-swap
is an RPM package project to create and swapon an swap image on EC2
instance store on Linux boot sequence.
Related
This question has been asked a couple of times on stackoverflow and other forums but I can't seem to get passed this error that I am getting. When I run capistrano production deploy, I get this error as part of the deploy process.
cap production bundler:install
00:00 bundler:install
01 bundle install --path /var/local/blackduck_flock_rails/shared/bundle --without development test --deployme…
01 An error occurred while installing json (1.8.6), and Bundler cannot continue.
01 Make sure that `gem install json -v '1.8.6'` succeeds before bundling.
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as serv-deployer#oh-utility01.dc1.lan: bundle exit status: 5
bundle stdout: An error occurred while installing json (1.8.6), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.6'` succeeds before bundling.
bundle stderr: Nothing written
Tasks: TOP => bundler:install
(See full trace by running task with --trace)
I've taken a look at my log/capistrano.log file and here are the relevant contents that I was looking at to trouble shoot.
# Logfile created on 2017-05-03 14:42:16 -0400 by logger.rb/54072
INFO ---------------------------------------------------------------------------
INFO START 2017-05-03 14:42:16 -0400 cap production bundler:install
INFO ---------------------------------------------------------------------------
DEBUG [ec1d281e] Running if test ! -d /var/local/blackduck_flock_rails/current; then echo "Directory does not exist '/var/local/blackduck_flock_rails/current'" 1>&2; false; fi as serv-deployer#oh-utility01.dc1.lan
DEBUG [ec1d281e] Command: if test ! -d /var/local/blackduck_flock_rails/current; then echo "Directory does not exist '/var/local/blackduck_flock_rails/current'" 1>&2; false; fi
DEBUG [ec1d281e] Finished in 0.328 seconds with exit status 0 (successful).
DEBUG [4f633904] Running /usr/bin/env bundle check --path /var/local/blackduck_flock_rails/shared/bundle as serv-deployer#oh-utility01.dc1.lan
DEBUG [4f633904] Command: cd /var/local/blackduck_flock_rails/current && /usr/bin/env bundle check --path /var/local/blackduck_flock_rails/shared/bundle
DEBUG [4f633904] Warning: the running version of Bundler is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
DEBUG [4f633904] The following gems are missing
* json (1.8.6)
* tzinfo (1.2.2)
* activesupport (4.2.6)
etc. etc..........
DEBUG [4f633904] * uglifier (3.0.4)
DEBUG [4f633904] Install missing gems with `bundle install`
DEBUG [4f633904] Finished in 0.179 seconds with exit status 1 (failed).
INFO [6c99e662] Running /usr/bin/env bundle install --path /var/local/blackduck_flock_rails/shared/bundle --without development test --deployment --quiet as serv-deployer#oh-utility01.dc1.lan
DEBUG [6c99e662] Command: cd /var/local/blackduck_flock_rails/current && /usr/bin/env bundle install --path /var/local/blackduck_flock_rails/shared/bundle --without development test --deployment --quiet
DEBUG [6c99e662] An error occurred while installing json (1.8.6), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.6'` succeeds before bundling.
So the first thing to note. The log is telling me that the running version of bundler is out of date and that I should install the newest one. Here is what I don't understand though. On my developing machine, I have Bundler version 1.14.6. On the targeting server that I am trying to deploy to, I also have Bundler version 1.14.6. I've confirmed it on both machines and they are indeed the same. Second, I have the same ruby versions for both developing machine and target machine. The ruby version is 2.2.5.
Second, when I run gem list on the target server, I can see that json 1.8.6 is installed.
json (1.8.3, 1.8.1)
What gives?
Finally, the problem has to be in this directory on the target machine /var/local/blackduck_flock_rails/shared/bundle. Inside the bundle directory, I have a ruby folder that has 1.9.1 and 2.2.0. Could this be the source of the problem. I'm stumped on this one and it seems that questions like these always relate to something specific on someone's machine that won't necessarily be applied. Help would be greatly appreciated.
The most probable cause is you're missing some system dependencies that capistrano cannot install.
Ssh to your server and try installing sudo apt-get install libgmp3-dev
If it doesn't fix the problem, ssh again and run the gem install json -v '1.8.6' as it tells you and post the error message you get from it here.
I defined ruby version 2.0.0-p645 in .ruby_version file
cap production deploy stops with bundler error:
INFO [11dd01a8] Running /usr/local/rvm/bin/rvm default do bundle install --path /var/www/p4-site/shared/bundle --without development test --deployment --quiet on p4-ocean
DEBUG [11dd01a8] Command: cd /var/www/p4-site/releases/20160206090913 && /usr/local/rvm/bin/rvm default do bundle install --path /var/www/p4-site/shared/bundle --without development test --deployment --quiet
DEBUG [11dd01a8] ruby-2.0.0-p481 is not installed.
DEBUG [11dd01a8] To install do: 'rvm install ruby-2.0.0-p481'
DEBUG [11dd01a8] /usr/local/rvm/scripts/set: line 19: exec: bundle: not found
(Backtrace restricted to imported tasks)
Gemfile doesn't contain ruby command
.bundle/config file contains
---
BUNDLE_WITHOUT: production
Where does bundler store ruby version 2.0.0-p481 ?
I am trying to install gitLab server in my Virtual Machines, When I Execute the command: sudo -u git -H bundle install --deployment --without development test mysql aws, I got this:
Some gems seem to be missing from your vendor/cache directory.
Could not find rake-10.3.2 in any of the sources
And my gem source is:
root#ubuntu:/home/git/gitlab# gem sources -l
*** CURRENT SOURCES ***
https://ruby.taobao.org/
https://rubygems.org/
When I run gem install rake-10.3.2, I got this:
ERROR: Could not find a valid gem 'rake-10.3.2' (>= 0) in any repository
How do I resolve this problem?
Try installing rake with this command
gem install rake -v 10.3.2
Do one thing. Delete your Gemfile.lock
and run the command:
bundle install
I am deploying Rails app using Capistrano to Centos VPS. On my VPS I can gem install pg, however when I run cap staging deploy, the process failed due to
An error occurred while installing pg (0.17.1), and Bundler cannot continue.
DEBUG[07a4f16d] Make sure that `gem install pg -v '0.17.1'` succeeds before bundling.
When the command 'cd /var/www/projectx/releases/20141117004357 && /usr/local/rvm/bin/rvm default do bundle install --binstubs /var/www/projectx/shared/bin --path /var/www/projectx/shared/bundle --without development test --deployment --quiet'
So on the VPS I can install pg gem globally, but it failed when it trys to run bundle in my release directory cd /var/www/projectx/releases/20141117004357
The error :
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-2.1.0/bin/ruby -r ./siteconf20141116-8316-zgkk04.rb extconf.rb --with-pg-config=/opt/local/lib/postgresql91/bin/pg_config
Using config values from /opt/local/lib/postgresql91/bin/pg_config
sh: /opt/local/lib/postgresql91/bin/pg_config: No such file or directory
sh: /opt/local/lib/postgresql91/bin/pg_config: No such file or directory
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.
Is it caused by --with-pg-config=/opt/local/lib/postgresql91/bin/pg_config, my pg_config is is a different location, how do I change this?
any idea?
Thanks
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?
Confirmed, I'm bypassing capistrano and it's a problem with bundler.
So why would gem install pg -v '0.16.0' work but bundle install not?
MORE ---
So, bundle install --system works. Then I can do a bundle install --local.
But a bundle install --local --deployment fails, 'could not find pg-0.16.0 in any of the sources'. I don't understand what that means, it's on the system and shows up in a 'gem list'.
I wonder if there's a way to force capistrano to do this?