私はUbuntu 14 LTSを実行するローカル仮想マシンに私のレールアプリケーションを配備しようとします。私はnginxとphusionの乗客を使用します。また、私は展開のためにカピストラーノの宝石を使用します。Capistrano gemを使用してUbuntuサーバーにRailsアプリケーションをデプロイ
仮想マシンの認証キーにローカルSSHキーを追加しました。
のssh [email protected]私が書くしかし
:
はまた、私はそのようにssh経由で私の仮想マシンへの接続問題がない
bundle exec cap production deploy
私は、取得するには、次のエラー:
cap aborted!
Net::SSH::Disconnect: connection closed by remote host
EOFError: end of file reached
Tasks: TOP => rbenv:validate
マイdeploy.rbファイル:
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
マイデプロイ/ production.rbファイル:
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])
マイnginx.confファイル:このような
server {
listen 80;
server_name 192.168.0.8;
charset utf-8;
rails_env production;
passenger_enabled on;
root /home/neil/mySimpleBlog/current/public;
}
缶あなたは[このスレッドでは、ソリューションを試してください(http://stackoverflow.com/questio) ns/33567498/capistrano-deploy-error-deploy-to-ubuntu-server)? – BoraMa
SSHでターゲティングサーバーにアクセスできますか? – qcam
ssh neil @ address_of_the_server 私は問題なくサーバにアクセスします。 – Neil