2013-10-11 14 views
14

私はgem capistranoレールカピストラーノ展開エラー

カピストラーノをインストールしているそして、私のアプリケーションディレクトリに私は、このコマンドはdeploy/production.rbdeploy/staging.rbが含まcap install

をインストールし、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) } 

そして、これは私が

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

を実行したときに

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 

そして最後に、私のdeploy.rbある - また1

私はしませんでしたrailsアプリケーションを実行するために私のサーバーに特別なインストールを行います。私はファイルをサーバーに最初に移動することに決めました。それは正しい方法ですか?

+0

'cap production deploy:setup'を実行しましたか?それがうまくいくのですか、同じエラーが出ますか? – CDub

+0

「タスクをビルドする方法がわからない」deploy:setup'' – overflow

+0

私のサーバーやgitに他のものを設定する必要があるかどうかを確認するには – overflow

答えて

12

設定するかわりに、役割名deployを設定する必要があります。ここで

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 

を実行したいです。

capistrano 3.0での設定もありません。

+2

優れた点です。私は彼が3.0を使っていたことを忘れていました。素晴らしいキャッチ。 – CDub

+1

あなたは上記のリンクを試しましたが、同じ問題に直面しています。手伝ってくれませんか。 – overflow

+0

サーバー上の設定はどのように行われますか?手動で?必要なフォルダ構造のmkdirを実行するタスクはありませんか? –