5

Ich bin mit Capistrano zu meinem neuen VPS bereitstellen. Nach der ersten Bereitstellung (Cap-Deployment) war alles in Ordnung (Site wurde ausgeführt), aber die zweite Deployment-Operation ist fehlgeschlagen: precompile error.Capistrano deploy - precompile Fehler

Ich laufe Schienen 3.2.13, Ruby 2.0.0, rvm.

Fehler:

* executing "cd -- /home/rails/releases/20140116121250 && RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile" 
servers: ["IP"] 
    [IP] executing command 
*** [err :: IP] bash: line 1: 23406 Killed   RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile 
    command finished in 84187ms 
*** [deploy:update_code] rolling back 
    * executing "rm -rf /home/rails/releases/20140116121250; true" 
    servers: ["IP"] 
    [IP] executing command 
    command finished in 519ms 
failed: "rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell 'default' -c 'cd -- /home/rails/releases/20140116121250 && RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile'" on IP 

deploy.rb Datei:

set :application, "app_name" 
set :repository, "git_repository" 

role :web, "IP"     
role :app, "IP"       
role :db, "IP", :primary => true 

set :user, "rails" 
set :password, "password" 

set :use_sudo, false 
set :deploy_to, "/home/rails/" 
set :deploy_via, :copy 

set :normalize_asset_timestamps, false 

require 'bundler/capistrano' 
require "rvm/capistrano" 
set :rvm_type, :system 

Capfile

load 'deploy' 
# Uncomment if you are using Rails' asset pipeline 
load 'deploy/assets' 
load 'config/deploy' # remove this line to skip loading any of the default tasks 

Ich bin ganz neu in Capistrano, so versuchen Sie bitte die Lösung klar zu erklären. Danke für Ihre Unterstützung!

+0

Kannst du diesen Befehl auf der Konsole ausführen? rvm_path =/usr/lokal/rvm/usr/local/rvm/bin/rvm-shell 'default' -c 'cd -/home/rails/releases/20140116121250 && RAILS_ENV = Produktion RAILS_GROUPS = Vermögenswerte Bund Le Exec Rake Vermögenswerte: Precompile'' – Mindbreaker

Antwort

2

Es scheint, als ob Sie auf Ihrem vpn-Server eine geringe Arbeitsspeichergröße haben. (Vpn liefert jetzt ohne Memory-Swap) also Betriebssystem tötet Ihren Deploy-Prozess.
Die Lösung ist Vermögen lokal (auf Ihrer Entwicklungsmaschine)

hinzufügen deploy:assets:precompile Aufgabe zu Ihrer deploy.rb Datei (dies ist für Capistrano 2)

namespace :deploy do 
    . . . 
    namespace :assets do 
     task :precompile, :roles => :web do 
     from = source.next_revision(current_revision) 
     if capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ lib/assets/ app/assets/ | wc -l").to_i > 0 
      run_locally("rake assets:clean && rake assets:precompile") 
      run_locally "cd public && tar -jcf assets.tar.bz2 assets" 
      top.upload "public/assets.tar.bz2", "#{shared_path}", :via => :scp 
      run "cd #{shared_path} && tar -jxf assets.tar.bz2 && rm assets.tar.bz2" 
      run_locally "rm public/assets.tar.bz2" 
      run_locally("rake assets:clean") 
     else 
      logger.info "Skipping asset precompilation because there were no asset changes" 
     end 
     end 
    end 
    end 

dann erneut bereitstellen kompilieren nur app Sie $ bundle exec cap deploy es wünschen hilft

Verwandte Themen