- 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/
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 10 年前。 Improve thi
Android 权限(您在 list 中请求并在安装时显示的权限)是否与 root 用户在 root 手机上获得的 linux 权限相同? 更确切地说:如果我的手机上有 root 权限并且我有一个可以
我经常读到 VIEW 的一个目的是安全性:允许一些用户访问基础表,而其他用户只允许访问派生 View 。考虑到这一点,我设计了几个向外部用户提供受限数据集的 View 。 一切都很好,但在实践中这是行
在 Facebook API v2.3 中,“user_posts”听起来像是“user_status”的超集。是这样吗?如果我已经有“user_posts”,为什么还需要“user_status”?
在为 BLUETOOTH_CONNECT 请求运行时权限后,android 12 崩溃了,我在 Samsung Android 12 设备中遇到了这个问题。在其他低于 Android 12 的设备上运
请理解这个问题可能有点头晕,因为这是我第一次提问。另外,请理解语法可能很奇怪,因为我不擅长英语并使用翻译。 我是一个在 Android 工作室中使用 java 制作应用程序的人。 尝试使用蓝牙时出现连
我刚刚将我的 Magento 商店从 cPanel 移动到 DirectAdmin (Centos)。 我的问题现在是权限。以前在 cPanel 上,所有文件夹都设置为 755 和文件 644。这很好
我希望在我的 Django 项目中获得更细粒度的权限,但无法决定使用哪个应用程序。 我所拥有的是这样的: class Item(models.Model): name = models.Cha
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 6年前关闭。 Improve thi
我们已经设置了一个 Github 应用程序,以便它使用 Github API 自动为另一个个人 Github 用户创建一个存储库。现在我们遇到了一个问题,不是每个人都想让我们完全读取他们所有的私有(p
假设我有一个网站想要访问 Facebook 的用户帐户信息。通常,用户会获得网站要求的所有权限,并且可以整体上允许或拒绝这些权限。 是否可以让用户选择(例如,通过授权屏幕上每个权限的复选框)他想授予网
平台下载地址:https://gitee.com/alwaysinsist/edp 权限介绍 权限实际上就是谁有权使用或是访问什么,这里的“谁”可以视作"授权对象",&qu
playstore 给我发这个消息 We've detected that your app contains the requestLegacyExternalStorage flag in the
我可以在没有 sudo 的情况下运行 docker,但有时它会再次请求权限,我无法在 VS 代码中附加容器 Got permission denied while trying to connect
我正在尝试在 Ubuntu 中的可执行文件上运行 gdb。但是,当我尝试在 gdb 中运行 run 时,出现以下错误。 /vagrant/unit_test: cannot execute: Perm
我的应用程序工作了一年,然后对 instagram 的 API 调用停止返回任何数据。 我使用以下 instagram 端点: https://api.instagram.com/v1/media/s
我使用 TFS 2012 并希望为 TFS 用户组设置以下权限。 允许创建新问题项。 拒绝创建新的任务项。 拒绝更改他的任务项,只能更改提醒时间、描述和状态。并且不能更改分配的用户、优先级和迭代。 我
我有一个谷歌计算引擎实例,我使用与我的 glcoud 帐户关联的 SSH key 通过 SFTP 连接到该实例。但是,我无法将任何文件上传到/var/www 目录,尽管我可以读取目录列表。/var/w
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许在 Stack Overflow 上提出有关通用计算硬件和软件的问题。您可以编辑问题,使其成为
我不确定如何正确处理以下情况: 我的程序通过安装程序安装 我在应用程序文件夹中创建SQLite数据库(程序启动时) 在某些配置中,我收到“ Attemt写入只读数据库”错误。这是权限问题,现在我通过将
我是一名优秀的程序员,十分优秀!