2012-02-25 55 views
5

我已經安裝了ruby(使用rvm),phusion乘客,&全部或需求。無法運行cap deploy:在ec2上設置,任務`deploy:setup'不存在

而且在EC2上我獲得成功的消息,當我運行$的ssh -T [email protected]

但是,當我嘗試運行 - > $帽部署:安裝,我得到一個錯誤信息 任務`部署:安裝」不存在

帽-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. 

這是我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

你的Capfile中有什麼? – 2012-02-26 19:46:21

回答

0

上的特定文件夾的權限是不正確的,搭配chmod 700的幫助。

2

這只是happenned給我,我被錯誤地輸入命令到已連接到VPS服務器的終端窗口,並得到同樣的錯誤:任務部署:更新不存在。

您需要在本地終端窗口中輸入cap命令。

14

轉到您的應用程序目錄,然後運行:

capify . 
+0

這對我有效! – RubyDev 2012-10-24 17:33:00

+0

新版本的capistrano有不同的命令。請看看https://github.com/capistrano/capistrano/blob/v3.3.3/README.md – 2014-11-30 09:18:05

0

Capify不工作作爲user1524695指出的那樣,但它真的找的是它加載內置部署線路

load 'deploy' 

任務。如果您在標準位置運行標準Capistrano腳本(config/deploy.rb和Capfile相對於您的工作目錄設置),Capfile將加載默認生成的config/deploy.rb。如果你正在運行在出於某種原因的任意位置的腳本,只需添加該行到腳本的頂部,然後

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

應該按預期工作,即使目錄不Capified。

1

如果你已經在你的deploy.rb啓用

require 'capistrano/ext/multistage' 

,正確的命令應該是

cap production deploy:setup