gpt4 book ai didi

ruby-on-rails - 为什么在尝试使用 capistrano 进行部署时出现 Psych 错误?

转载 作者:行者123 更新时间:2023-12-01 09:29:41 25 4
gpt4 key购买 nike

我目前正在我的 Rails 3.2.13 应用程序中设置 capistrano。我收到以下错误/详细信息(包括“第 1 行第 1 列不允许使用控制字符”)。我已经对此进行了一些搜索,但没有看到任何与我相关的内容。

我正在使用 rvm-capistrano 和 ruby​​ 2.0.0-p195。我最近将我的应用程序所需的环境变量移到了 .bashrc 中。

...      
* 2013-06-10 15:18:32 executing `deploy:assets:update_asset_mtimes'
* executing "[ -e /home/deployer/apps/super_rad_app/shared/assets/manifest* ] && cat /home/deployer/apps/super_rad_app/shared/assets/manifest* || echo"
servers: ["107.20.249.163"]
[107.20.249.163] executing command
command finished in 6238ms
*** [deploy:update_code] rolling back
* executing "rm -rf /home/deployer/apps/super_rad_app/releases/20130610221258; true"
servers: ["107.20.249.163"]
[107.20.249.163] executing command
** [out :: 107.20.249.163] Using /home/deployer/.rvm/gems/ruby-2.0.0-p195
command finished in 6623ms
/home/nate/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): control characters are not allowed at line 1 column 1 (Psych::SyntaxError)
from /home/nate/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
from /home/nate/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/psych.rb:153:in `parse'
from /home/nate/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/psych.rb:129:in `load'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/recipes/deploy/assets.rb:26:in `parse_manifest'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/namespaces.rb:191:in `method_missing'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/namespaces.rb:191:in `method_missing'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/recipes/deploy/assets.rb:93:in `block (3 levels) in load'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/execution.rb:138:in `instance_eval'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/execution.rb:138:in `invoke_task_directly'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/execution.rb:89:in `execute_task'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/execution.rb:101:in `find_and_execute_task'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/callback.rb:38:in `call'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/callbacks.rb:141:in `block in trigger'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/callbacks.rb:141:in `each'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/callbacks.rb:141:in `trigger'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/callbacks.rb:23:in `invoke_task_directly_with_callbacks'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/execution.rb:89:in `execute_task'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/execution.rb:101:in `find_and_execute_task'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/callback.rb:38:in `call'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/callbacks.rb:141:in `block in trigger'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/callbacks.rb:141:in `each'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/callbacks.rb:141:in `trigger'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/callbacks.rb:27:in `invoke_task_directly_with_callbacks'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/execution.rb:89:in `execute_task'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/namespaces.rb:191:in `method_missing'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/namespaces.rb:110:in `block in define_task'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/recipes/deploy.rb:234:in `block (3 levels) in load'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/execution.rb:56:in `transaction'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/namespaces.rb:191:in `method_missing'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/recipes/deploy.rb:233:in `block (2 levels) in load'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/execution.rb:138:in `instance_eval'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/execution.rb:138:in `invoke_task_directly'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/execution.rb:89:in `execute_task'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/namespaces.rb:191:in `method_missing'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/namespaces.rb:110:in `block in define_task'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/recipes/deploy.rb:201:in `block (2 levels) in load'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/execution.rb:138:in `instance_eval'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/execution.rb:138:in `invoke_task_directly'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/execution.rb:89:in `execute_task'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/configuration/execution.rb:101:in `find_and_execute_task'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/cli/execute.rb:46:in `block in execute_requested_actions'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/cli/execute.rb:45:in `each'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/cli/execute.rb:45:in `execute_requested_actions'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/cli/help.rb:19:in `execute_requested_actions_with_help'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/cli/execute.rb:34:in `execute!'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/lib/capistrano/cli/execute.rb:14:in `execute'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.4/bin/cap:4:in `<top (required)>'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/bin/cap:23:in `load'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/bin/cap:23:in `<main>'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `eval'
from /home/nate/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `<main>'

最佳答案

我也遇到过这个问题,但原因不同。我们正在使用 rvm-capistrano,我们的项目有一个 .rvmrc 文件。 deploy:assets:update_asset_mtimes Capistrano 任务在服务器上运行一个 shell 命令来捕获 Assets list 的内容。部署中存在 .rvmrc 文件生成了来自 RVM 的“您正在使用 '.rvmrc',它需要信任...”警告,该警告无意中成为了 shell 命令输出的一部分。我只是在使用 puts 语句对本地 capistrano gem 中的 assets.rb 配方进行检测后才看到这一点。

我通过在服务器上运行“rvm rvmrc warning ignore all.rvmrcs”解决了我的问题,然后再次部署。

另一个选择是从 .rvmrc 和整个信任的东西切换到使用 .ruby-version 方法。见 Use rvmrc or ruby-version file to set a project gemset with RVM?了解详情。

关于ruby-on-rails - 为什么在尝试使用 capistrano 进行部署时出现 Psych 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17033816/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com