- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
尝试通过 gem Capistrano 将我的应用程序部署到主机时遇到问题。通过 SSH key 授权一切正常。我有下一个错误:
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as hosting_yurta24@calcium.locum.ru: scp: /tmp/yurta24/git-ssh.sh: Permission denied
scp: /tmp/yurta24/git-ssh.sh: Permission denied
我的 deploy.rb 文件是:
lock '3.4.0'
require 'net/ssh/proxy/http'
sshproxy = Net::SSH::Proxy::HTTP.new('x.x.x.x', 8080)
set :ssh_options, { :proxy => sshproxy }
application = 'yurta24'
login = 'yurta24'
$user = 'hosting_' + login
$server = 'calcium.locum.ru'
rvm_ruby_string = '2.1.5p273'
deploy_to = "/home/#{ $user }/projects/#{ application }"
unicorn_conf = "/etc/unicorn/#{ application }.#{ login }.rb"
unicorn_pid = "/var/run/unicorn/#{ $user }/#{ application }.#{ login }.pid"
unicorn_start_cmd = "(cd #{ deploy_to }/current; rvm use #{ rvm_ruby_string } do bundle exec unicorn_rails -Dc #{ unicorn_conf })"
set :application, application
set :repo_url, "https://github.com/verrom/yurta24.git"
set :deploy_to, deploy_to
set :pty, true
set :default_env, { path: "/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/rvm/bin" }
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
end
end
after :publishing, :restart
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
end
end
end
我的 production.rb 文件是:
connect_to = "#{$user}@#{$server}"
role :app, [connect_to]
role :web, [connect_to]
role :db, [connect_to]
set :enable_ssl, true
完整的错误列表是:
verevkinra@ubuntu:~/apps/yurta24$ cap production deploy:check
DEBUG [b5b4061f] Running /usr/bin/env [ -d ~/.rvm ] as hosting_yurta24@calcium.locum.ru
DEBUG [b5b4061f] Command: [ -d ~/.rvm ]
DEBUG [b5b4061f] Finished in 1.346 seconds with exit status 1 (failed).
DEBUG [8c816727] Running /usr/bin/env [ -d /usr/local/rvm ] as hosting_yurta24@calcium.locum.ru
DEBUG [8c816727] Command: [ -d /usr/local/rvm ]
DEBUG [8c816727] Finished in 0.180 seconds with exit status 0 (successful).
DEBUG [a427409d] Running /usr/local/rvm/bin/rvm version as hosting_yurta24@calcium.locum.ru
DEBUG [a427409d] Command: ( PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/rvm/bin /usr/local/rvm/bin/rvm version )
DEBUG [a427409d] rvm 1.26.11 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
DEBUG [a427409d] Finished in 0.468 seconds with exit status 0 (successful).
rvm 1.26.11 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
DEBUG [205f64d3] Running /usr/local/rvm/bin/rvm current as hosting_yurta24@calcium.locum.ru
DEBUG [205f64d3] Command: ( PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/rvm/bin /usr/local/rvm/bin/rvm current )
DEBUG [205f64d3] system
DEBUG [205f64d3] Finished in 0.399 seconds with exit status 0 (successful).
system
DEBUG [730c9a49] Running /usr/local/rvm/bin/rvm default do ruby --version as hosting_yurta24@calcium.locum.ru
DEBUG [730c9a49] Command: ( PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/rvm/bin /usr/local/rvm/bin/rvm default do ruby --version )
DEBUG [730c9a49] ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]
DEBUG [730c9a49] Finished in 0.613 seconds with exit status 0 (successful).
ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]
INFO [4c8c1c1b] Running /usr/bin/env mkdir -p /tmp/yurta24/ as hosting_yurta24@calcium.locum.ru
DEBUG [4c8c1c1b] Command: ( PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/rvm/bin /usr/bin/env mkdir -p /tmp/yurta24/ )
INFO [4c8c1c1b] Finished in 0.173 seconds with exit status 0 (successful).
DEBUG Uploading /tmp/yurta24/git-ssh.sh 0.0%
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as hosting_yurta24@calcium.locum.ru: scp: /tmp/yurta24/git-ssh.sh: Permission denied
scp: /tmp/yurta24/git-ssh.sh: Permission denied
我的 Gemfile 是:
gem 'capistrano-rails'
gem 'capistrano-bundler'
gem 'capistrano-rvm'
gem 'capistrano-rbenv'
gem 'unicorn'
第二个错误列表是:
rake aborted!
Cannot load `Rails.application.database_configuration`:
Could not load database configuration. No such file - ["config/database.yml"]
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/application/configuration.rb:110:in `database_configuration'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.4/lib/active_record/railtie.rb:117:in `block (2 levels) in <class:Railtie>'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:44:in `each'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.4/lib/active_record/base.rb:315:in `<module:ActiveRecord>'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.4/lib/active_record/base.rb:26:in `<top (required)>'
/home/hosting_yurta24/projects/yurta24/releases/20151020084626/config/initializers/dragonfly.rb:24:in `<top (required)>'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `block in load'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/engine.rb:652:in `block in load_config_initializer'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/notifications.rb:166:in `instrument'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/engine.rb:651:in `load_config_initializer'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/engine.rb:615:in `each'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/engine.rb:615:in `block in <class:Engine>'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/initializable.rb:30:in `instance_exec'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/initializable.rb:30:in `run'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/initializable.rb:44:in `each'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/initializable.rb:44:in `tsort_each_child'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/initializable.rb:54:in `run_initializers'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/application.rb:352:in `initialize!'
/home/hosting_yurta24/projects/yurta24/releases/20151020084626/config/environment.rb:5:in `<top (required)>'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/application.rb:328:in `require'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/application.rb:328:in `require_environment!'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/application.rb:457:in `block in run_tasks_blocks'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/sprockets-rails-2.3.3/lib/sprockets/rails/task.rb:64:in `block (2 levels) in define'
Could not load database configuration. No such file - ["config/database.yml"]
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/application/configuration.rb:110:in `database_configuration'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.4/lib/active_record/railtie.rb:117:in `block (2 levels) in <class:Railtie>'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:44:in `each'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.4/lib/active_record/base.rb:315:in `<module:ActiveRecord>'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.4/lib/active_record/base.rb:26:in `<top (required)>'
/home/hosting_yurta24/projects/yurta24/releases/20151020084626/config/initializers/dragonfly.rb:24:in `<top (required)>'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `block in load'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/engine.rb:652:in `block in load_config_initializer'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/notifications.rb:166:in `instrument'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/engine.rb:651:in `load_config_initializer'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/engine.rb:615:in `each'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/engine.rb:615:in `block in <class:Engine>'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/initializable.rb:30:in `instance_exec'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/initializable.rb:30:in `run'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/initializable.rb:44:in `each'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/initializable.rb:44:in `tsort_each_child'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/initializable.rb:54:in `run_initializers'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/application.rb:352:in `initialize!'
/home/hosting_yurta24/projects/yurta24/releases/20151020084626/config/environment.rb:5:in `<top (required)>'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/application.rb:328:in `require'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/application.rb:328:in `require_environment!'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/railties-4.2.4/lib/rails/application.rb:457:in `block in run_tasks_blocks'
/home/hosting_yurta24/projects/yurta24/shared/bundle/ruby/2.1.0/gems/sprockets-rails-2.3.3/lib/sprockets/rails/task.rb:64:in `block (2 levels) in define'
Tasks: TOP => environment
(See full trace by running task with --trace)
rake stderr: Nothing written
Tasks: TOP => deploy:assets:precompile
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as hosting_yurta24@calcium.locum.ru: rake exit status: 1
谢谢。
最佳答案
由于这是一个权限问题,它可能是许多事情之一;但是,请确保您的用户“hosting_yurta24”拥有/tmp 目录
$ sudo chown hosting_yurta24 /tmp
这可能是因为您在创建此用户时没有为其分配管理权限。
关于您的第二个问题,capistrano 报告说您的 VPS 上没有 database.yml
文件。我还假设您没有 secrets.yml
。以下是创建它们的方法:
首先确保你有这两个目录。如果您还没有它们,请创建它们:
/home/hosting_yurta24/projects/yurta24/shared/config
/home/hosting_yurta24/projects/yurta24/log
第一个目录将保存您的项目和数据库配置。第二个目录对于您的应用程序保存其日志至关重要。他们都必须在那里!
现在! cd 进入 /home/hosting_yurta24/projects/yurta24/shared/config
并创建两个文件
database.yml
secrets.yml
在 database.yml 中粘贴以下内容:
production:
adapter: postgresql # if your using postgresql
encoding: unicode
pool: 5
timeout: 5000
database: yurta24_production # database name
username: postgres # database username
password: password # database password
host: localhost
回到您的本地机器,进入您的 Rails 项目目录并从终端输入:
rake secret
终端应该转储一长串字符串和数字的混合物。这是您的应用程序 secret 。复制它然后在你的 VPS secrets.yml 上:
production:
secret_key_base: apsifq193uq8djf1jqe8er18jee9jd8eqeh8fqe8fqehh8qehfq # paste your secret here
希望这对您有所帮助。
关于ruby-on-rails - SSHKit::Runner::ExecuteError 权限被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33228227/
我在自己的 ubuntu 服务器上有一个简单的 gitlab-runner 设置。它是使用以下方式注册的: sudo gitlab-runner register -n --url https://g
我的 flutter 项目不适用于 ios 设备。 我试过下面的命令sudo gem install cocoapods . flutter 跑: Warning: CocoaPods not ins
我有一个包含2 个作业的管道。 我在 windows 上使用 Debug模式以 super 用户身份启动用户并收到下一个输出: Checking for jobs... received
当我尝试构建我的应用程序时,我在控制台中收到此错误: Xcode build done. 114,3s Failed
我试图让 Karma runner 在 Jenkins 构建期间生成 cobertura 格式的代码覆盖率报告。我可以让它生成一个coverage.xml 文件,但它实际上没有任何覆盖数据。似乎(使用
我正在使用 Windows 10 并使用 Gitlab's doc 安装了 gitlab-runner . 成功安装和注册后,我尝试离开我用来安装的文件夹(C:\Gitlab-Runner 在我的实例
我正在使用 Windows 10 并使用 Gitlab's doc 安装了 gitlab-runner . 成功安装和注册后,我尝试离开我用来安装的文件夹(C:\Gitlab-Runner 在我的实例
我正在尝试创建一个 kubernetes gitlab 运行程序,但遇到了非常普遍的错误 Failed to register the runner. You may be having networ
我曾经在 github 上有一个项目 travis和一个 appveyor已配置集成服务。因此,我能够确保我的项目在 OSX 和 Windows 平台上都可以正常编译。 我现在正在使用 gitlab
在我们的 Gitlab 服务器上,我有两个存储库,其中一个存储库('EPSILON-SDK-C')是另一个存储库中的子模块。当我在我的开发人员机器上本地运行 gitlab-runner sudo g
我正在使用带有 docker+machine 执行程序的 gitlab 运行程序来启动 AWS 上的自动缩放运行程序。我想在运行者中使用 docker-in-docker setup 来构建容器,但我
关于announcement关于 SonarQube 与 MSBuild 和 Team Build 的集成,谁能就 SonarQube Runner 和 SonarQube.MSBuild.Runne
我正在尝试使用带有 shell 执行程序的 gitlab-runner 提取代码。 $ git pull origin master error: cannot open .git/FETCH_H
我正在尝试对远程 Weblogic 12.1.x 进行非常简单的 Arquillian 测试,例如我有以下内容 public class MyBean { } 然后是测试 @RunWith(Arqui
我的环境是 Centos 7,我刚刚安装了 gitlab-runner,当我以安装 gitlab-runner 的用户身份运行此命令时(不是以 root 身份) sudo gitlab-runner
我的环境是 Centos 7,我刚刚安装了 gitlab-runner,当我以安装 gitlab-runner 的用户身份运行此命令时(不是以 root 身份) sudo gitlab-runner
我正在尝试在 Android Studio 中运行仪器测试。 我已经研究并尝试了很多,但我无法克服这个错误消息。 我的模块依赖: (编译) +--- com.crashlytics.sdk.andro
我正在尝试执行我的以下测试套件: import unittest from Login_Page import LoginPageAndLogout def test_suite(): # g
我刚刚使用来自 sonarqube.com 的指南在 Windows 7 上安装了 sonnar runner 我在C盘安装了sonnarqube4.5和sonar-runner,但是我的项目在D盘的
我使用 Dataflow 运行程序测试了我的代码,但它返回错误: > Error message from worker: java.lang.RuntimeException: > org.apac
我是一名优秀的程序员,十分优秀!