2016-04-10 29 views
0

Raylarımı ubuntu 14 LTS çalıştıran yerel sanal makineye dağıtmayı deniyorum. Ben nginx ve phusion yolcuları kullanıyorum. Ayrıca, dağıtım için capistrano gem kullanıyorum.Capistrano gemini kullanarak Ubuntu sunucusunda Raylar uygulamasını uygulama

Yerel ssh anahtarımı sanal makinenin yetkili anahtarlarına ekledim.
ssh [email protected] Yazıyorum Ancak

:
Ayrıca ben böyle ssh ile benim sanal makineye bağlanmak sorun

bundle exec cap production deploy 

alıyorum aşağıdaki hata:

cap aborted! 

Net::SSH::Disconnect: connection closed by remote host 

EOFError: end of file reached 

Tasks: TOP => rbenv:validate 

Benim deploy.rb dosyası:

server "192.168.0.8", port: 80, roles: %i(:web :app :db), primary: true 
set :log_level, :debug 

set :application, "mySimpleBlog" 
set :repo_url, "[email protected]:NeilAlishev/mySimpleBlog.git" 
set :user,   "neil" 
set :linked_files, fetch(:linked_files, []).push("config/database.yml", "config/secrets.yml") 
set :linked_dirs, fetch(:linked_dirs, []).push("log", "tmp/pids", "tmp/cache", "tmp/sockets", 
    "vendor/bundle", "public/system", "public/uploads") 
set :deploy_to,  "/home/#{fetch(:user)}/src/#{fetch(:application)}" 

set :rbenv_type, :user 
set :rbenv_ruby, "2.2.4" 
set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} "\ 
    "RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec" 
set :rbenv_map_bins, %w(rake gem bundle ruby rails) 
set :rbenv_roles, :all 

namespace :deploy do 
    desc "Restart application" 
    task :restart do 
    on roles(:app), in: :sequence, wait: 5 do 
     execute :touch, release_path.join("tmp/restart.txt") 
    end 
    end 

    after :publishing, "deploy:restart" 
    after :finishing, "deploy:cleanup" 
end 

My dağıtma/production.rb dosyası:

set :stage, :production 
server "192.168.0.8", user: "neil", roles: %w(web app db) 
role :app, %w([email protected]) 
role :web, %w([email protected]) 
role :db, %w([email protected]) 

Benim nginx.conf dosyası: Böyle

server { 
listen 80; 
server_name 192.168.0.8; 
charset utf-8; 
rails_env production; 
passenger_enabled on; 
root /home/neil/mySimpleBlog/current/public; 
} 
+0

Can [bu konudaki] çözümleri deneyin (http://stackoverflow.com/questio ns/33567498/capistrano-dağıtmak-hata-süre-dağıtma-to-ubuntu-sunucuya)? – BoraMa

+0

SSH'yi hedefleme sunucusuna yapabileceğinizden emin misiniz? – qcam

+0

Sadece ssh neil @ address_of_the_server yazıyor Sunucuya sorunsuz bir şekilde erişiyorum. – Neil

cevap

0

Değişim production.rb,

role :app, 'address_of_the_server', { 
:ssh_options => { 
:keys => 'key_path(like ~/.ssh/key_name.pem)' 
} 
} 

role :web, 'address_of_the_server', { 
:ssh_options => { 
:keys => 'key_path(like ~/.ssh/key_name.pem)' 
} 
} 

role :db, 'address_of_the_server', { 
:ssh_options => { 
    :keys => 'key_path(like ~/.ssh/key_name.pem)' 
} 
} 
+0

' ile aynı hatayı aldım Yardımcı olmadım, aynı hatayı aldım – Neil