首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >“无法在任何源中找到并发-ruby-1.1.7”时,部署rails时

“无法在任何源中找到并发-ruby-1.1.7”时,部署rails时
EN

Stack Overflow用户
提问于 2020-10-18 15:37:19
回答 1查看 7.2K关注 0票数 3

我在这里看到了很多类似的问题,但没有提供任何帮助。每次运行cap production deploy时都会出现错误:

代码语言:javascript
运行
复制
...
 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

代码语言:javascript
运行
复制
# 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

代码语言:javascript
运行
复制
# 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添加到项目之后),但是当我运行包更新时,我得到了关于concurrent-ruby-1.1.7的错误。我已经试过了

Gemfile.lock

  • Run

  • 删除 bundle upadte并捆绑安装
  1. 将此代码添加到Capfile

代码语言:javascript
运行
复制
      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没有显示任何错误。我遗漏了什么?提前谢谢你!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-10-21 15:11:37

我是怎么解决的:

  1. 转到服务器命令行
  2. ,我们在错误日志中可以看到,出现错误之前的最后一个命令是:

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.

  1. 在同一个文件夹中运行bundle install,安装了gem之后,我们可以退出服务器命令行。
  2. 运行cap production deploy,一切都会好起来的。

我仍然不知道这个错误的根本问题是什么,也不知道如何永久地修复它,但这对我来说是有效的。我希望这对其他任何人都有帮助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64415137

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档