gpt4 book ai didi

ruby-on-rails - SSHKit::Command::Failed: bundle stdout: 没有为 capistrano 写的

转载 作者:太空宇宙 更新时间:2023-11-03 16:59:35 26 4
gpt4 key购买 nike

当我执行 cap production deploy 时,我收到以下错误:

cap aborted!
SSHKit::Command::Failed: bundle stdout: Nothing written
bundle stderr: Nothing written

gem 文件:

gem 'capistrano'
gem 'capistrano-rails', '~> 1.1'
gem 'rvm1-capistrano3', require: false
gem 'capistrano-bundler'

标题:

# Load DSL and Setup Up Stages
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rails'
require 'capistrano/bundler'
require 'rvm1/capistrano3'

# Includes default deployment tasks

# Includes 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/tree/master/assets
# https://github.com/capistrano/rails/tree/master/migrations
#
# require 'capistrano/rvm'
# require 'capistrano/rbenv'
# require 'capistrano/chruby'
# require 'capistrano/bundler'
# require 'capistrano/rails/assets'
# require 'capistrano/rails/migrations'

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

部署.rb

require 'capistrano/bundler'
set :application, 'firm'
set :scm, :git
set :stage, :production
set :branch, "master"
set :repo_url, url
set :deploy_to, "/path/"
set :linked_files, fetch(:linked_files, []).push('config/database.yml')
set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'public/system', 'public/pdfs')
# specify how many releases Capistrano should store on server's harddrive
set :keep_releases, 5
set :bundle_without, [:development]
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
# set :deploy_to, '/var/www/my_app'
# set :scm, :git

# set :format, :pretty
set :log_level, :trace
#set :rvm_type, :system
# set :pty, true

# set :linked_files, %w{config/database.yml}
# set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

# set :default_env, { path: "/opt/ruby/bin:$PATH" }
# set :keep_releases, 5
set :rvm1_ruby_version, "2.2.1"
set :rvm_ruby_string, :local
#SSHKit.config.command_map[:rake] = "~/.rvm/bin/#{fetch(:application)}_bundle exec rake"
set :bundle_flags, '--deployment --quiet'
set :bundle_gemfile, -> { release_path.join('Gemfile') }
set :bundle_dir, -> { shared_path.join('bundle') }
set :bundle_without, %w{test development}.join(' ')
set :bundle_binstubs, -> { shared_path.join('bin') }
namespace :deploy do

desc "Symlink shared config files"
task :symlink_config_files do
sh "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
end

end

最佳答案

你有多少内存?

我刚刚自己解决了这个问题,确实是RAM的问题。

你可以试试:

  1. 重新启动服务器,再次尝试部署。
  2. 增加服务器上的 SWAP。

关于ruby-on-rails - SSHKit::Command::Failed: bundle stdout: 没有为 capistrano 写的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35909638/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com