- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
尝试使用Puma / Nginx / Capistrano在EC2实例上部署Rails应用程序。我正在关注this tutorial.
这是我的第一次部署,不确定到底发生了什么。从控制台输出来看,我的ssh配置似乎有问题,但是我真的不确定什么帮助将不胜感激。
这是deploy.rb
server '52.206.222.73', roles: %w{web app db}, primary: true
set :repo_url, 'git@example.com:username/myapp.git'
set :application, 'myapp'
set :user, 'deploy'
set :puma_threads, [4, 16]
set :puma_workers, 0
# Don't change these unless you know what you're doing
set :pty, true
set :use_sudo, false
set :stage, :production
set :deploy_via, :remote_cache
set :deploy_to, "/home/#{fetch(:user)}/#{fetch(:application)}"
set :puma_bind, "unix://#{shared_path}/tmp/sockets/#{fetch(:application)}-puma.sock"
set :puma_state, "#{shared_path}/tmp/pids/puma.state"
set :puma_pid, "#{shared_path}/tmp/pids/puma.pid"
set :puma_access_log, "#{release_path}/log/puma.error.log"
set :puma_error_log, "#{release_path}/log/puma.access.log"
set :ssh_options, { forward_agent: true, user: fetch(:user), keys: %w(~/.ssh/id_rsa.pub) }
set :puma_preload_app, true
set :puma_worker_timeout, nil
set :puma_init_active_record, true # Change to false when not using ActiveRecord
## Defaults:
# set :scm, :git
# set :branch, :master
# set :format, :pretty
# set :log_level, :debug
# set :keep_releases, 5
## Linked Files & Directories (Default None):
# set :linked_files, %w{config/database.yml}
# set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
namespace :puma do
desc 'Create Directories for Puma Pids and Socket'
task :make_dirs do
on roles(:app) do
execute "mkdir #{shared_path}/tmp/sockets -p"
execute "mkdir #{shared_path}/tmp/pids -p"
end
end
** Execute git:wrapper
00:00 git:wrapper
01 mkdir -p /tmp
✔ 01 deploy@52.206.222.73 0.695s
Uploading /tmp/git-ssh-myapp-production-adam.sh 100.0%
02 chmod 700 /tmp/git-ssh-myapp-production-adam.sh
✔ 02 deploy@52.206.222.73 0.921s
** Execute git:check
00:04 git:check
01 git ls-remote --heads git@example.com:username/amharic-web.git
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@52.206.222.73: git exit status: 128
git stdout: Nothing written
git stderr: Nothing written
/Users/adam/.rvm/gems/ruby-2.3.0/gems/sshkit-1.11.1/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute'
/Users/adam/.rvm/gems/ruby-2.3.0/gems/sshkit-1.11.1/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
SSHKit::Command::Failed: git exit status: 128
git stdout: Nothing written
git stderr: Nothing written
/Users/adam/.rvm/gems/ruby-2.3.0/gems/sshkit-1.11.1/lib/sshkit/command.rb:100:in `exit_status='
/Users/adam/.rvm/gems/ruby-2.3.0/gems/sshkit-1.11.1/lib/sshkit/backends/netssh.rb:148:in `execute_command'
/Users/adam/.rvm/gems/ruby-2.3.0/gems/sshkit-1.11.1/lib/sshkit/backends/abstract.rb:141:in `block in create_command_and_execute'
/Users/adam/.rvm/gems/ruby-2.3.0/gems/sshkit-1.11.1/lib/sshkit/backends/abstract.rb:141:in `tap'
/Users/adam/.rvm/gems/ruby-2.3.0/gems/sshkit-1.11.1/lib/sshkit/backends/abstract.rb:141:in `create_command_and_execute'
/Users/adam/.rvm/gems/ruby-2.3.0/gems/sshkit-1.11.1/lib/sshkit/backends/abstract.rb:74:in `execute'
/Users/adam/.rvm/gems/ruby-2.3.0/gems/capistrano-3.6.0/lib/capistrano/git.rb:10:in `git'
/Users/adam/.rvm/gems/ruby-2.3.0/gems/capistrano-3.6.0/lib/capistrano/git.rb:20:in `check'
/Users/adam/.rvm/gems/ruby-2.3.0/gems/capistrano-3.6.0/lib/capistrano/tasks/git.rake:34:in `block (4 levels) in <top (required)>'
/Users/adam/.rvm/gems/ruby-2.3.0/gems/sshkit-1.11.1/lib/sshkit/backends/abstract.rb:93:in `with'
/Users/adam/.rvm/gems/ruby-2.3.0/gems/capistrano-3.6.0/lib/capistrano/tasks/git.rake:33:in `block (3 levels) in <top (required)>'
/Users/adam/.rvm/gems/ruby-2.3.0/gems/sshkit-1.11.1/lib/sshkit/backends/abstract.rb:29:in `instance_exec'
/Users/adam/.rvm/gems/ruby-2.3.0/gems/sshkit-1.11.1/lib/sshkit/backends/abstract.rb:29:in `run'
/Users/adam/.rvm/gems/ruby-2.3.0/gems/sshkit-1.11.1/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => git:check
The deploy has failed with an error: Exception while executing as deploy@52.206.222.73: git exit status: 128
git stdout: Nothing written
git stderr: Nothing written
** Invoke deploy:failed (first_time)
** Execute deploy:failed
** DEPLOY FAILED
** Refer to log/capistrano.log for details. Here are the last 20 lines:
DEBUG [34726536] -
DEBUG [34726536] .
DEBUG [34726536] |
DEBUG [34726536] /
DEBUG [34726536] -
DEBUG [34726536] \
DEBUG [34726536] .\
DEBUG [34726536] .
DEBUG [34726536] ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
DEBUG [34726536] Finished in 1.755 seconds with exit status 0 (successful).
INFO [2219decf] Running /usr/bin/env mkdir -p /tmp as deploy@52.206.222.73
DEBUG [2219decf] Command: /usr/bin/env mkdir -p /tmp
INFO [2219decf] Finished in 0.695 seconds with exit status 0 (successful).
DEBUG Uploading /tmp/git-ssh-myapp-production-adam.sh 0.0%
INFO Uploading /tmp/git-ssh-myapp-production-adam.sh 100.0%
INFO [38c56cdb] Running /usr/bin/env chmod 700 /tmp/git-ssh-myapp-production-adam.sh as deploy@52.206.222.73
DEBUG [38c56cdb] Command: /usr/bin/env chmod 700 /tmp/git-ssh-myapp-production-adam.sh
INFO [38c56cdb] Finished in 0.921 seconds with exit status 0 (successful).
INFO [4ce4f406] Running /usr/bin/env git ls-remote --heads git@example.com:username/amharic-web.git as deploy@52.206.222.73
DEBUG [4ce4f406] Command: ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-myapp-production-adam.sh" ; /usr/bin/env git ls-remote --heads git@example.com:username/amharic-web.git )*
最佳答案
我很惊讶,Git没有提供更具描述性的错误消息。但是,由于某些原因,git ls-remote
命令失败。在没有任何错误消息的情况下,最好的猜测是Git无法访问远程存储库。
这可能是因为:
cap
命令的位置)上,尝试通过SSH手动运行相同的Git命令,看看会发生什么:
ssh -A -i ~/.ssh/id_rsa.pub deploy@52.206.222.73 git ls-remote --heads git@example.com:username/amharic-web.git
关于ruby-on-rails - Capistrano在git:check上部署失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38639026/
我是 Capistrano 的新手,我想知道为我的项目管理 Capistrano 配置的最佳方法是什么。 具体应该在哪里config/deploy.rb与我的项目的源代码控制相关吗?我应该存储没有特定
我正在使用 Capistrano 管理在多个负载平衡服务器上运行的 Java Web 应用程序。某些任务(例如配置更改)需要重新启动服务器或重新部署应用程序,在此期间服务器变得无响应。 如果 Capi
有没有办法可以看到 capistrano 任务依赖树?我有一个大项目,有很多任务和依赖项,但我对整个画面一无所知。 帕纳约蒂斯 最佳答案 在 Capistrano 3 中,您可以添加 --trace
我有一个命名空间和一些在 deploy:updated 之后运行的命名空间中的任务。下面是一个例子: namespace :myservice do task :start do on r
我想在运行 deploy:migrate 任务之前停止一些进程。我知道我可以通过复制现有代码并在任务的开头和结尾添加停止/启动步骤来重新定义 deploy:migrate 任务。 我想知道是否有办法避
我将如何更改 Capistrano 使用的临时目录? 示例:代替 /tmp ,我想用/home/user/tmp 我现在的 VPS 有 /tmp安装为 noexec ,这使我在尝试运行时获得了权限被拒
使用 Capistrano,如何回滚到特定版本? 我服务器的文件夹有一个/release 文件夹,我如何回滚到特定的文件夹? 我是否可以在本地获取计算机上的版本列表? 我正在使用 GIT,但这不起作用
我尝试使用“cap rollback”,但出现以下错误: $ cap rollback the task `rollback' does not exist 我需要做一些额外的设置才能使回滚正常工作吗
我正在使用 Capistrano 部署 ruby on Rails 项目。我正在尝试以用户“部署”身份登录远程服务器并部署此应用程序。 当我通过 ssh 进入框进行部署并 git 克隆项目时,它可
我正在使用 Capistrano 部署 ruby on Rails 项目。我正在尝试以用户“部署”身份登录远程服务器并部署此应用程序。 当我通过 ssh 进入框进行部署并 git 克隆项目时,它可
我正在使用 capistrano、capistrano/rbenv、capistrano/bundler 和 capistrano/rails。我在 capistrano 编译 Assets 的步骤中
尝试将此代码块授予 capistrano 的版本 3 但无济于事。一切都变了。任何人都可以帮助我在正确的轨道上进行转换吗? 旧版本 2 deploy.rb: #require 'new_relic/r
我对这两种工具都是新手,还没有完全掌握。 如果我使用 Capistrano 进行部署,为什么 Gradle 是部署目标? 另见 Gradle Overview . 最佳答案 Gradle 是从 Gro
如何使用 Capistrano v3 仅部署到一台服务器?我在那里发现的所有解决方案都部署到每台服务器,因此,我认为它们适用于 v2。 我不想部署一个阶段,我已经在使用多阶段,我只想在其中一个阶段部署
在 Capistrano Multi-staging documentation set :deploy_env, 'production'用来。是 deploy_env同 rails_env其中te
部署应用程序时,我将 Capistrano 与 capistrano_rsync_with_remote_cache gem 一起使用。 使用新软件升级部署服务器后出现问题: 卡皮斯特拉诺 2.5.1
capistrano-chef 是否有替代品?厨师独奏的 gem ?主要是为了避免两次定义服务器信息。 最佳答案 我在这个话题上发现了一些新鲜而热门的东西: Roundsman gem 文件: gem
我正在尝试通过遵循 DOCS 来学习使用 Capistrano 3,并且我编写了一个简单的任务来测试我的理解。 任务在默认 task 中创建目录在 lib/capistrano/tasks : d
我有一个 capistrano 任务,它整合了 Rails 项目的多个阶段的部署。 例如: task :consolidated_task do build #creates a new re
来自 deploy.rb 的片段 task :prod1 do set :deploy_to, "/home/project/src/prod1" end task :prod2 do set
我是一名优秀的程序员,十分优秀!