"Could not find concurrent-ruby-1.1.7 in any of the sources" 使用 Capistrano 部署时 rails
"Could not find concurrent-ruby-1.1.7 in any of the sources" when deploy rails with capistrano
我在这里看到了很多类似的问题,但提供的建议都没有帮助。每次我 运行 cap production deploy
我得到错误:
...
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
我的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'
我的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]
第一条消息是关于 rollbar gem(部署是在我将这个 gem 添加到项目之后),但是当我 运行 包更新时,我得到了关于concurrent-ruby-1.1.7
。我已经试过了:
- 移除Gemfile.lock
- 运行 捆绑更新和捆绑安装
- 将此代码添加到 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'
}
- 运行
bundle exec cap production deploy:updated
cap production deploy:check
没有显示任何错误。我错过了什么?提前致谢!
我是怎么解决的:
- 转到服务器命令行
- 正如我们在错误日志中看到的,错误出现前的最后一条命令是:
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 )
所以我们去我们的文件夹:
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
之后我们看到同样的错误:
Could not find concurrent-ruby-1.1.7 in any of the sources. Run 'bundle install' to install missing gems.
- 在同一文件夹 运行
bundle install
中 gem 安装后我们可以退出服务器命令行。
- 运行
cap production deploy
一切都会好起来的。
我仍然不知道这个错误的根本问题是什么,以及如何永久修复它,但这对我有用。我希望它对其他人有用。
我在这里看到了很多类似的问题,但提供的建议都没有帮助。每次我 运行 cap production deploy
我得到错误:
...
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
我的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'
我的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]
第一条消息是关于 rollbar gem(部署是在我将这个 gem 添加到项目之后),但是当我 运行 包更新时,我得到了关于concurrent-ruby-1.1.7
。我已经试过了:
- 移除Gemfile.lock
- 运行 捆绑更新和捆绑安装
- 将此代码添加到 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'
}
- 运行
bundle exec cap production deploy:updated
cap production deploy:check
没有显示任何错误。我错过了什么?提前致谢!
我是怎么解决的:
- 转到服务器命令行
- 正如我们在错误日志中看到的,错误出现前的最后一条命令是:
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 )
所以我们去我们的文件夹:
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
之后我们看到同样的错误:
Could not find concurrent-ruby-1.1.7 in any of the sources. Run 'bundle install' to install missing gems.
- 在同一文件夹 运行
bundle install
中 gem 安装后我们可以退出服务器命令行。 - 运行
cap production deploy
一切都会好起来的。
我仍然不知道这个错误的根本问题是什么,以及如何永久修复它,但这对我有用。我希望它对其他人有用。