2012-02-25 28 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