Ruby on rails 4 Capistrano 3未部署并显示此错误SSHKit::Command::Failed:rake stdout:未写入任何内容
我使用了rails 4和Capistrano 3。当我使用Capistrano进行depoly时,在rake资产期间失败:预编译并显示以下错误Ruby on rails 4 Capistrano 3未部署并显示此错误SSHKit::Command::Failed:rake stdout:未写入任何内容,ruby-on-rails-4,capistrano3,Ruby On Rails 4,Capistrano3,我使用了rails 4和Capistrano 3。当我使用Capistrano进行depoly时,在rake资产期间失败:预编译并显示以下错误 INFO [1c9c2531] Running ~/.rvm/bin/rvm default do bundle exec rake assets:precompile on 107.170.67.113 cap aborted! SSHKit::Command::Failed: rake stdout: Nothing written rake st
INFO [1c9c2531] Running ~/.rvm/bin/rvm default do bundle exec rake assets:precompile on 107.170.67.113
cap aborted!
SSHKit::Command::Failed: rake stdout: Nothing written
rake stderr: Nothing written
Tasks: TOP => deploy:assets:precompile
(See full trace by running task with --trace)
我是rails和服务器安装方面的新手,所以我错过了什么?我不知道
这是我的depoly.rb
SSHKit.config.command_map[:rake] ||= "bundle exec rake"
# config valid only for Capistrano 3.1
lock '3.0.1'
set :application, 'PCA'
set :repo_url, 'git@github.com:3lackRos3/pca.git'
# Default branch is :master
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call
# Default deploy_to directory is /var/www/my_app
set :deploy_to, '/home/pca/app/pca'
set :deploy_user, 'pca'
set :rvm_ruby_string, ENV['GEM_HOME'].gsub(/.*\//,"")
set :rvm_type, :user
set :rvm_bin_path, '/usr/local/rvm/bin'
# set :default_environment, {
# 'RBENV_ROOT' => '/usr/local/rbenv',
# 'PATH' => "/usr/local/rbenv/shims:/usr/local/rbenv/bin:$PATH"
# }
# set :default_environment, {
# 'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
# }
# set :rbenv_ruby, "2.1.1"
# set :rbenv_ruby_dir, -> { "#{fetch(:rbenv_path)}/versions/#{fetch(:rbenv_ruby)}" }
# set :rbenv_map_bins, %w{rake gem bundle ruby rails}
# Default value for :scm is :git
set :scm, :git
set :ssh_options, { forward_agent: true }
#set :ssh_options, proxy: Net::SSH::Proxy::Command.new('ssh pca@107.170.67.113 -W %h:%p')
# Default value for :format is :pretty
# set :format, :pretty
set :log_level, :info
# Default value for :log_level is :debug
# set :log_level, :debug
# Default value for :pty is false
set :pty, true
# Default value for :linked_files is []
# set :linked_files, %w{config/database.yml}
# Default value for linked_dirs is []
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
# SSHKit.config.command_map[:rake].sub!(/\(.*\)rake/, "\1bundle exec rake")
# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
# Default value for keep_releases is 5
# set :keep_releases, 20
after "deploy", "deploy:cleanup"
namespace :deploy do
desc 'Restart application'
task :restart do
# on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
# execute :touch, release_path.join('tmp/restart.txt')
# end
end
after :publishing, :restart
after :restart, :clear_cache do
# on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
# within release_path do
# execute :rake, 'cache:clear'
# end
# end
end
after :finishing, 'deploy:cleanup'
end
这是我的卷宗
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
#require 'rvm1/capistrano3'
#require 'capistrano/rvm'
# 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
#
require 'capistrano/rvm'
# require 'capistrano/rbenv'
# require 'capistrano/chruby'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano/rails'
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
我已经运行了bundle exec cap生产部署:检查和
我的输出是
INFO [ecf1a980] Running /usr/bin/env mkdir -p /tmp/PCA/
INFO [ecf1a980] Finished in 4.848 seconds with exit status 0 (successful).
INFO Uploading /tmp/PCA/git-ssh.sh 100.0%
INFO [8e7210f6] Running /usr/bin/env chmod +x /tmp/PCA/git-ssh.sh on serverip
INFO [8e7210f6] Finished in 0.639 seconds with exit status 0 (successful).
INFO [4c538c51] Running /usr/bin/env mkdir -pv /home/pca/app/pca/shared /home/pca/app/pca/releases
INFO [4c538c51] Finished in 4.480 seconds with exit status 0 (successful).
INFO [d6a7dce6] Running /usr/bin/env mkdir -pv /home/pca/app/pca/shared/bin /home/pca/app/pca/shared/log /home/pca/app/pca/shared/tmp/pids /home/pca/app/pca/shared/tmp/cache /home/pca/app/pca/shared/tmp/sockets /home/pca/app/pca/shared/vendor/bundle /home/pca/app/pca/shared/public/system
INFO [d6a7dce6] Finished in 4.507 seconds with exit status 0 (successful).
有人帮帮我吗
谢谢 确保在gits可信密钥中包含正在进行部署的服务器的ssh密钥。由于内存不足,似乎是预编译进程终止。 尝试创建交换内存。
查看教程我也有同样的问题,在运行(部署)cap production deploy时出现错误
rake stderr:Nothing writed
原来是因为内存不足,我有一个1G内存服务器,所以“解决方案是创建一个交换内存”。对我来说,创建2G交换内存修复了它。部署现在继续并完成,没有任何错误。我已将服务器ssh密钥添加到github,我可以将代码从github克隆到服务器,但显示相同的错误。感谢回复服务器上的用户如何?pca有完全的权利吗?pca完全的权利意味着什么?我让服务器安装程序按照本链接教程检查您是否能够在本地计算机上预编译资产。运行以下命令:bundle exec rake assets:precompilei已运行bundle exec rake assets:precompile并显示此I,[2014-05-03T19:32:39.240102#7366]信息--:Writing/home/karchigh/PCA/public/assets/application-b99fcf3794f0636a75d634e284bdb.js[2014-05-03T19:32:39.323888#7366]信息--:正在写入/home/karchigh/PCA/public/assets/application-c048e94d8279e043fc2a7116c2788e6f.cssany参考。。。?