"Could not find concurrent-ruby-1.1.7 in any of the sources" when deploy rails with capistrano

Viewed 6671

I saw a lot of similar questions here, but nothing of provided advises has helped. Every time I run cap production deploy I got error:

...
 DEBUG [9b1f0199] Running RBENV_ROOT=$HOME/.rbenv RBENV_VERSION=2.6.5 $HOME/.rbenv/shims/bundle exec bundle check as deploy@199.192.25.241
 DEBUG [9b1f0199] Command: cd /home/deploy/project/releases/20201018151933 && ( export RAILS_ENV="production" RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.6.5" ; RBENV_ROOT=$HOME/.rbenv RBENV_VERSION=2.6.5 $HOME/.rbenv/shims/bundle exec bundle check )
 DEBUG [9b1f0199]       Could not find concurrent-ruby-1.1.7 in any of the sources
Run `bundle install` to install missing gems.
 DEBUG [9b1f0199] Finished in 1.400 seconds with exit status 7 (failed).
  INFO [f0be72cf] Running RBENV_ROOT=$HOME/.rbenv RBENV_VERSION=2.6.5 $HOME/.rbenv/shims/bundle exec bundle install --jobs 1 --without development test --deployment --quiet as deploy@199.192.25.241
 DEBUG [f0be72cf] Command: cd /home/deploy/project/releases/20201018151933 && ( export RAILS_ENV="production" RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.6.5" ; RBENV_ROOT=$HOME/.rbenv RBENV_VERSION=2.6.5 $HOME/.rbenv/shims/bundle exec bundle install --jobs 1 --without development test --deployment --quiet )
 DEBUG [f0be72cf]       Could not find concurrent-ruby-1.1.7 in any of the sources
Run `bundle install` to install missing gems.
#<Thread:0x00007feee097d1d8@/Users/ruslan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
        13: from /Users/ruslan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
        12: from /Users/ruslan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:31:in `run'
        11: from /Users/ruslan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:31:in `instance_exec'
        10: from /Users/ruslan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/capistrano-bundler-1.6.0/lib/capistrano/tasks/bundler.cap:26:in `block (3 levels) in <top (required)>'
         9: from /Users/ruslan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:92:in `within'
         8: from /Users/ruslan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/capistrano-bundler-1.6.0/lib/capistrano/tasks/bundler.cap:27:in `block (4 levels) in <top (required)>'
         7: from /Users/ruslan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:100:in `with'
         6: from /Users/ruslan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/capistrano-bundler-1.6.0/lib/capistrano/tasks/bundler.cap:39:in `block (5 levels) in <top (required)>'
         5: from /Users/ruslan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:80:in `execute'
         4: from /Users/ruslan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:148:in `create_command_and_execute'
         3: from /Users/ruslan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:148:in `tap'
         2: from /Users/ruslan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:148:in `block in create_command_and_execute'
         1: from /Users/ruslan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/backends/netssh.rb:170:in `execute_command'
/Users/ruslan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/command.rb:97:in `exit_status=': bundle exit status: 7 (SSHKit::Command::Failed)
bundle stdout: Could not find concurrent-ruby-1.1.7 in any of the sources
Run `bundle install` to install missing gems.
bundle stderr: Nothing written
        1: from /Users/ruslan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
/Users/ruslan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as deploy@199.192.25.241: bundle exit status: 7 (SSHKit::Runner::ExecuteError)
bundle stdout: Could not find concurrent-ruby-1.1.7 in any of the sources
Run `bundle install` to install missing gems.
bundle stderr: Nothing written
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@199.192.25.241: bundle exit status: 7
bundle stdout: Could not find concurrent-ruby-1.1.7 in any of the sources
Run `bundle install` to install missing gems.
bundle stderr: Nothing written


Caused by:
SSHKit::Command::Failed: bundle exit status: 7
bundle stdout: Could not find concurrent-ruby-1.1.7 in any of the sources
Run `bundle install` to install missing gems.
bundle stderr: Nothing written

Tasks: TOP => deploy:updated => bundler:install
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as deploy@199.192.25.241: bundle exit status: 7
bundle stdout: Could not find concurrent-ruby-1.1.7 in any of the sources
Run `bundle install` to install missing gems.
bundle stderr: Nothing written

My Capfile:

# frozen_string_literal: true

# Load DSL and set up stages
require 'capistrano/setup'

# Include default deployment tasks
require 'capistrano/deploy'

# Load the SCM plugin appropriate to your project:
#
# require "capistrano/scm/hg"
# install_plugin Capistrano::SCM::Hg
# or
# require "capistrano/scm/svn"
# install_plugin Capistrano::SCM::Svn
# or
require 'capistrano/scm/git'
install_plugin Capistrano::SCM::Git

# Include tasks from other gems included in your Gemfile
#
# For documentation on these, see for example:
#
#   https://github.com/capistrano/rvm
#   https://github.com/capistrano/rbenv
#   https://github.com/capistrano/chruby
#   https://github.com/capistrano/bundler
#   https://github.com/capistrano/rails
#   https://github.com/capistrano/passenger
#
# require "capistrano/rvm"
require 'capistrano/rbenv'
require 'capistrano/rails'
# require "capistrano/chruby"
require 'capistrano/bundler'
# require 'capistrano/rails/assets'
# require 'capistrano/rails/migrations'
require 'capistrano/passenger'

# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }

set :rbenv_type, :user
set :rbenv_ruby, '2.6.5'

My Gemfile:

# frozen_string_literal: true

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.6.5'

gem 'aasm'
gem 'aws-sdk-s3', require: false
gem 'bcrypt', require: 'bcrypt'
gem 'bootsnap', '>= 1.4.2', require: false
gem 'devise'
gem 'draper'
gem 'factory_bot_rails'
gem 'ffaker'
gem 'gon'
gem 'image_processing', '~> 1.2'
gem 'jbuilder', '~> 2.7'
gem 'mini_magick'
gem 'omniauth'
gem 'omniauth-facebook'
gem 'omniauth-line'
gem 'pg', '>= 0.18', '< 2.0'
gem 'puma', '~> 4.1'
gem 'pundit'
gem 'rails', '~> 6.0.3'
gem 'ransack', github: 'activerecord-hackery/ransack'
gem 'rollbar'
gem 'ruby-vips', '~> 2.0.17'
gem 'sass-rails', '>= 6'
gem 'serviceworker-rails'
gem 'slim-rails'
gem 'strong_migrations'
gem 'travis'
gem 'turbolinks', '~> 5'
gem 'webpacker', '~> 4.0'

group :development, :test do
  gem 'byebug', platforms: %i[mri mingw x64_mingw]
  gem 'rspec-rails', '~> 4.0.0'
end

group :development do
  gem 'capistrano', '~> 3.6'
  gem 'capistrano-bundler', '~> 1.6'
  gem 'capistrano-passenger', '~> 0.2.0'
  gem 'capistrano-rails', '~> 1.4'
  gem 'capistrano-rbenv', '~> 2.1', '>= 2.1.4'
  gem 'letter_opener'
  gem 'listen', '~> 3.2'
  gem 'rubocop'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
  gem 'web-console', '>= 3.3.0'
end

group :test do
  gem 'capybara', '>= 2.15'
  gem 'database_cleaner-active_record'
  gem 'rails-controller-testing'
  gem 'selenium-webdriver'
  gem 'shoulda-matchers'
  gem 'simplecov', require: false
  gem 'webdrivers'
end

gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]

First message was about rollbar gem (and deploy was after I've added this gem to project), but when I run bundle update, I got this error about concurrent-ruby-1.1.7. I've tried already:

  1. Remove Gemfile.lock
  2. Run bundle upadte and bundle install
  3. Add this code to Capfile:
      set :default_environment, {
        :PATH => '$HOME/.rbenv/versions/2.6.5/bin:$PATH',
        :GEM_HOME => '$HOME/.rbenv/versions/2.6.5',
        :GEM_PATH => '$HOME/.rbenv/versions/2.6.5:$HOME/.rbenv/versions/2.6.5@global'
      }
  1. Run bundle exec cap production deploy:updated

cap production deploy:check doesn't show any error. What am I missing? Thank you so much in advance!

1 Answers

How I solved it:

  1. Go to server command line
  2. As we can see in error log, the last command before error appears was:

Command: cd /home/deploy/project/releases/20201018151933 && ( export RAILS_ENV="production" RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.6.5" ; RBENV_ROOT=$HOME/.rbenv RBENV_VERSION=2.6.5 $HOME/.rbenv/shims/bundle exec bundle check )

So we go to our folder:

cd /home/deploy/project/releases/20201018151933

and run there command:

export RAILS_ENV="production" RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.6.5" ; RBENV_ROOT=$HOME/.rbenv RBENV_VERSION=2.6.5 $HOME/.rbenv/shims/bundle exec bundle check

After that we see same error:

Could not find concurrent-ruby-1.1.7 in any of the sources. Run 'bundle install' to install missing gems.

  1. In same folder run bundle install and after gem installed we can exit out of server command line.
  2. Run cap production deploy and everything is gonna be fine.

I still don't know what is the root problem of this error, and how to fix it permanently, but this works for me. I hope it will be useful for anyone else.

Related