2013-10-11 16 views
14

मैं स्थापित किया है Capistrano मैं स्थापित cap installरेल Capistrano तैनाती त्रुटि

यह आदेश deploy/production.rb भी शामिल है और deploy/staging.rb और में config/deploy.rb

मेरी production.rb फ़ाइल निम्न है

set :stage, :production 
role :all, %w{[email protected]} 
server 'sub.mydomain.com', user: 'deploy', roles: %w{web app}, my_property: :my_value 
set :ssh_options, { :forward_agent => true, :port => 1754, :keys => %w(/home/seting/.ssh/id_rsa) } 

और ये मेरे deploy.rb

set :application, 'admin' 
set :repo_url, '[email protected]:username/myadmin.git' 
namespace :deploy do 

    desc 'Restart application' 
    task :restart do 
    on roles(:app), in: :sequence, wait: 5 do 
     # Your restart mechanism here, for example: 
     # execute :touch, release_path.join('tmp/restart.txt') 
    end 
    end 

    after :restart, :clear_cache do 
    on roles(:web), in: :groups, limit: 3, wait: 10 do 
     # Here we can do anything such as: 
     # within release_path do 
     # execute :rake, 'cache:clear' 
     # end 
    end 
    end 

    after :finishing, 'deploy:cleanup' 

end 

और है अंत में जब मैं के रूप में

cap aborted! 
seting 
/home/seting/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh.rb:215:in `start' 
/home/seting/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:156:in `ssh' 
/home/seting/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:68:in `upload!' 
/home/seting/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0/lib/capistrano/tasks/git.rake:11:in `block (3 levels) in <top (required)>' 
/home/seting/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:42:in `instance_exec' 
/home/seting/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:42:in `run' 
/home/seting/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.0.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute' 
Tasks: TOP => git:check => git:wrapper 
(See full trace by running task with --trace) 

संपादित cap production deploy

हो रही त्रुटियों को चलाने - 1

इसके अलावा मैं नहीं था में रेल अनुप्रयोग चलाने के लिए मेरे सर्वर में कोई विशेष स्थापना करें। मैंने अपनी फाइल को पहले सर्वर पर ले जाने का फैसला किया है। क्या यह सही तरीका है?

+0

क्या आप 'टोपी उत्पादन तैनाती: सेटअप' चलाते हैं? क्या यह काम करता है या आपको एक ही त्रुटि देता है? – CDub

+0

'कार्य को कैसे बनाना है' के रूप में त्रुटि नहीं है: सेटअप ' – overflow

+0

चाहे मुझे अपने सर्वर में या गिट – overflow

उत्तर

12

आपको सेटिंग के बजाय भूमिका का नाम तैनात करना चाहिए, या अन्य तरीकों से।

set :stage, :production 
set :branch, 'master' 
set :deploy_to, '/srv/www/server.com/' 
role :all, %w{[email protected]} 
server 'server.com', user: 'deploy', roles: %w{web app}, my_property: :my_value 
fetch(:default_env).merge!(rails_env: :production) 

यहाँ guide

है और आप शायद

cap production deploy:check 

अपने config जाँच करने के लिए चलाना चाहते हैं।

इसके अलावा कोई तैनाती नहीं है: कैपिस्ट्रानो 3.0

+2

में किसी और चीज को कॉन्फ़िगर करना है या नहीं। मुझे याद आया कि वह 3.0 का उपयोग कर रहा था। ग्रेट कैच – CDub

+1

मैंने आपके ऊपर दिए गए उपरोक्त लिंक की कोशिश की लेकिन एक ही समस्या का सामना करना पड़ा। क्या आप मेरी मदद कर सकते हैं। – overflow

+0

सर्वर पर सेटअप कैसे किया जाता है? मैन्युअल? आवश्यक फ़ोल्डर संरचना के लिए mkdir करने का कोई काम नहीं है? –

संबंधित मुद्दे