2012-02-25 10 views
5

Tôi đã cài đặt ruby ​​(sử dụng rvm), hành khách phusion, & tất cả hoặc yêu cầu.Không thể chạy triển khai giới hạn: thiết lập trên ec2, nhiệm vụ `deploy: setup 'không tồn tại

Cũng trên EC2 tôi nhận được thông báo thành công khi tôi chạy $ ssh -T [email protected]

Nhưng khi tôi cố gắng chạy -> $ nắp triển khai: thiết lập, tôi nhận được một thông báo lỗi nhiệm vụ ' triển khai: thiết lập' không tồn tại

nắp -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. 

đây là deploy.rb tôi

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

Có gì trong tệp Capfile của bạn? –

Trả lời

0

Các điều khoản trên thư mục cụ thể là không đúng, chmod 700 giúp.

2

này chỉ happenned với tôi, tôi đã nhầm lẫn cách gõ lệnh vào cửa sổ terminal được kết nối với máy chủ vps và nhận được lỗi tương tự: các triển khai nhiệm vụ: Cập nhật không tồn tại.

Bạn cần nhập lệnh nắp vào cửa sổ đầu cuối cục bộ của mình.

14

Đến thư mục ứng dụng của bạn và chạy:

capify . 
+0

Điều này làm việc cho tôi! – RubyDev

+0

Phiên bản mới của capistrano có lệnh khác. Vui lòng xem https://github.com/capistrano/capistrano/blob/v3.3.3/README.md –

0

Capify làm việc như user1524695 chỉ ra, nhưng những gì nó đang thực sự tìm kiếm là dòng

load 'deploy' 

mà tải được xây dựng trong triển khai nhiệm vụ. Nếu bạn đang chạy một kịch bản Capistrano chuẩn ở các vị trí tiêu chuẩn (với config/deploy.rb và Capfile được thiết lập liên quan đến thư mục làm việc của bạn), Capfile sẽ tải cấu hình/deploy.rb nó được tạo ra theo mặc định. Nếu bạn đang chạy một kịch bản trong một vị trí tùy ý đối với một số lý do, chỉ cần thêm dòng đó vào đầu của kịch bản của bạn, sau đó

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

nên làm việc như mong đợi, ngay cả khi thư mục được không Capified.

1

Nếu bạn đã bật

require 'capistrano/ext/multistage' 

trong deploy.rb của bạn, lệnh đúng sẽ là

cap production deploy:setup