I'm trying to install the newest version of gitlab. When I try
sudo -u git -H bundle install --deployment --without development test mysql was --verbose
It always shows an error Network error while fetching, and re-fetches all the packages again when I retry, then the error appears again because my network is not stable. How to tell the bundler not to fetch packages already fetched?
Try adding the bundle install --retry option:
sudo -u git -H bundle install --retry 4 --deployment --without development test mysql was --verbose
This will retry failed network requests 4 times. From the Bundler Documentation:
--retry: Retry network and git requests that have failed.
Note: if it complains about Unknown switches '--retry', then your bundler version is very old. update it with:
gem update bundler
and then try again.
Related
I'm deploying a rails app to Google Cloud App Engine. Since adding
config.action_mailer.default_url_options = { host: 'foobar.appspot.com'}
to production.rb, the build fails on deploy. Here are the logs:
INFO[0108] RUN bundle install --deployment --without="development test" && rbenv rehash
INFO[0108] cmd: /bin/sh
INFO[0108] args: [-c bundle install --deployment --without="development test" && rbenv rehash]
/bin/sh: 1: bundle: not found
error building image: error building stage: waiting for process to exit: exit status 127
There are 2 options, which you should to try:
Change bundle to bundler.
install bundler manually with something like gem install bundler -v 1.17.1
I'm upgrading my Gitlab install but have an issue: the migration fails because it misses a dependency. Which look installed. That's weird.
$ sudo -u git -H bundle install --without postgres development test --deployment
Using timfel-krb5-auth 0.8.3
# ...
Using vmstat 2.3.0
Using webpack-rails 0.9.9
Using wikicloth 0.8.1
Bundle complete! 187 Gemfile dependencies, 266 gems now installed.
Gems in the groups postgres, development and test were not installed.
Bundled gems are installed into `./vendor/bundle`
Looks like timfel-krb5-auth is installed. But here is the output of migrating:
$ sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
Could not find timfel-krb5-auth-0.8.3 in any of the sources
Run `bundle install` to install missing gems.
Any idea how to fix this?
I fixed it by dropping all installed dependencies:
$ rm -rf ./vendor ./.bundle/
Then re-install:
$ sudo -u git -H bundle install --without postgres development test --deployment
And finally, I got errors due to the wrong Gemfile. I found a solution here: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11787/diffs
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 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'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?