当我执行cap production deploy
时,我收到以下错误:
cap aborted!
SSHKit::Command::Failed: bundle stdout: Nothing written
bundle stderr: Nothing written
Gemfile公司:
gem 'capistrano'
gem 'capistrano-rails', '~> 1.1'
gem 'rvm1-capistrano3', require: false
gem 'capistrano-bundler'
CAP文件:
# 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问题。
您可以尝试:
重新启动服务器,再次尝试部署。
增加服务器上的交换。
关于ruby-on-rails - SSHKit::Command::Failed:bundle stdout:没有为capistrano编写任何内容,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35909638/