2012-02-25 12 views
5

Ho installato ruby ​​(utilizzando rvm), phusion passenger, & tutti o requisiti.Impossibile eseguire la distribuzione cap: setup su ec2, l'attività `deploy: setup 'non esiste

Anche su EC2 ricevo un messaggio di successo quando si esegue $ ssh -T [email protected]

ma quando provo a correre -> $ tappo Deploy: messa a punto, ottengo un messaggio di errore il task ` distribuire: setup' non esiste

tappo -VT

➜ bridge1 git:(master) cap -vT 
cap bundle:install # Install the current Bundler environment. 
cap deploy:restart # 
cap deploy:start # 
cap deploy:stop # 
cap invoke   # Invoke a single command on the remote servers. 
cap shell   # Begin an interactive Capistrano session. 

Extended help may be available for these tasks. 
Type `cap -e taskname' to view it. 

questo è il mio deploy.rb

require 'bundler/capistrano' 
#using RVM! 
$:.unshift("#{ENV["HOME"]}/.rvm/lib") 
require "rvm/capistrano" 
set :rvm_type, :user 


set :application, "capi_app" 
set :deploy_to, "/var/www/#{application}" 

role :web, "184.169.135.60"       # Your HTTP server, Apache/etc 
role :app, "184.169.135.60"       # This may be the same as your `Web` server 
role :db, "184.169.135.60", :primary => true # This is where Rails migrations will run 


default_run_options[:pty] = true 
set :repository, "[email protected]:jaipratik/gibridge1.git" 
set :scm, :git 
set :branch, "master" 


set :user, "ubuntu"    
set :use_sudo, false 
set :admin_runner, "ubuntu" 

set :rails_env, 'production'  
#set :use_sudo, false #if error delete this 


# If you are using Passenger mod_rails uncomment this: 
namespace :deploy do 
    task :start do ; end 
    task :stop do ; end 
    task :restart, :roles => :app, :except => { :no_release => true } do 
    run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" 
    end 
end 

Gemfile

source 'https://rubygems.org' 

gem 'rails', '3.2.1' 

# Bundle edge Rails instead: 
# gem 'rails', :git => 'git://github.com/rails/rails.git' 

gem 'sqlite3' 


# Gems used only for assets and not required 
# in production environments by default. 
group :assets do 
    gem 'sass-rails', '~> 3.2.3' 
    gem 'coffee-rails', '~> 3.2.1' 

    # See https://github.com/sstephenson/execjs#readme for more supported runtimes 
    # gem 'therubyracer' 

    gem 'uglifier', '>= 1.0.3' 
end 

gem 'jquery-rails' 

# To use ActiveModel has_secure_password 
# gem 'bcrypt-ruby', '~> 3.0.0' 

# To use Jbuilder templates for JSON 
# gem 'jbuilder' 

# Use unicorn as the web server 
# gem 'unicorn' 

# Deploy with Capistrano 
gem 'capistrano' 

# To use debugger 
# gem 'ruby-debug19', :require => 'ruby-debug' 


group :test do 
    # Pretty printed test output 
    gem 'turn', :require => false 
end 


group :production do 
    gem 'therubyracer' 
end 
+0

Cosa c'è nel tuo Capfile? –

risposta

0

Le autorizzazioni per la cartella specifica non era giusto, chmod 700 ha aiutato.

2

Questo solo happenned a me, mi è stato erroneamente digitando il comando nella finestra di terminale che è stato connesso al server VPS e ottenere lo stesso errore: il deploy compito: aggiornamento non esiste.

È necessario digitare il comando cap nella finestra del terminale locale.

14

Vai alla directory dell'applicazione ed eseguire:

capify . 
+0

Questo ha funzionato per me! – RubyDev

+0

La nuova versione di capistrano ha un comando diverso. Si prega di dare un'occhiata https://github.com/capistrano/capistrano/blob/v3.3.3/README.md –

0

Capify funziona come user1524695 sottolineato, ma che cosa sta veramente cercando è la linea

load 'deploy' 

che carica il deploy incorporato compiti. Se stai eseguendo uno script Capistrano standard nelle posizioni standard (con config/deploy.rb e Capfile impostati relativi alla tua directory di lavoro), Capfile caricherà il file config/deploy.rb che ha generato per impostazione predefinita. Se si sta eseguendo uno script in una posizione arbitraria per qualche motivo, basta aggiungere che la linea alla parte superiore dello script, quindi

cap -f /path/to/myscript.rb deploy:setup 

dovrebbe funzionare come previsto, anche se la directory non è Capified.

1

Se è stata attivata

require 'capistrano/ext/multistage' 

nel vostro deploy.rb, il comando corretto sarebbe

cap production deploy:setup