在此上下文中不允许使用Capistrano映射进行部署时出现psych.rb错误

时间:2013-03-31 17:00:52

标签: ruby-on-rails capistrano

我正在尝试将Rails应用程序部署到CentOS 6 / nginx / passenger服务器,但是cap部署:cold正在给我一个错误。以下是部署输出的相关部分:

  * 2013-03-31 17:49:59 executing `deploy:assets:update_asset_mtimes'
  * executing "[ -e /home/appuser/apps/britaincares/shared/assets/manifest.yml ] && cat /home/appuser/apps/britaincares/shared/assets/manifest.yml || echo"
    servers: ["www.britaincares.co.uk"]
    [www.britaincares.co.uk] executing command
    command finished in 303ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/appuser/apps/britaincares/releases/20130331164733; true"
    servers: ["www.britaincares.co.uk"]
    [www.britaincares.co.uk] executing command
 ** [out :: www.britaincares.co.uk] /home/appuser/.bashrc: eval: line 26: syntax error: unexpected end of file
    command finished in 932ms
/Users/chriswickett/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/psych.rb:203:in `parse': (<unknown>): mapping values are not allowed in this context at line 1 column 28 (Psych::SyntaxError)
    from /Users/chriswickett/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
    from /Users/chriswickett/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/psych.rb:151:in `parse'
    from /Users/chriswickett/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/psych.rb:127:in `load'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/recipes/deploy/assets.rb:63:in `block (3 levels) in load'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/execution.rb:138:in `instance_eval'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/execution.rb:138:in `invoke_task_directly'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/execution.rb:89:in `execute_task'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/execution.rb:101:in `find_and_execute_task'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/callback.rb:38:in `call'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/callbacks.rb:141:in `block in trigger'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/callbacks.rb:141:in `each'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/callbacks.rb:141:in `trigger'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/callbacks.rb:23:in `invoke_task_directly_with_callbacks'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/execution.rb:89:in `execute_task'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/execution.rb:101:in `find_and_execute_task'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/callback.rb:38:in `call'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/callbacks.rb:141:in `block in trigger'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/callbacks.rb:141:in `each'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/callbacks.rb:141:in `trigger'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/callbacks.rb:27:in `invoke_task_directly_with_callbacks'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/execution.rb:89:in `execute_task'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/namespaces.rb:191:in `method_missing'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/namespaces.rb:110:in `block in define_task'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/recipes/deploy.rb:229:in `block (3 levels) in load'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/execution.rb:56:in `transaction'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/namespaces.rb:191:in `method_missing'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/recipes/deploy.rb:228:in `block (2 levels) in load'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/execution.rb:138:in `instance_eval'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/execution.rb:138:in `invoke_task_directly'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/execution.rb:89:in `execute_task'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/namespaces.rb:191:in `method_missing'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/namespaces.rb:110:in `block in define_task'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/recipes/deploy.rb:517:in `block (2 levels) in load'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/execution.rb:138:in `instance_eval'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/execution.rb:138:in `invoke_task_directly'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/execution.rb:89:in `execute_task'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/configuration/execution.rb:101:in `find_and_execute_task'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/cli/execute.rb:46:in `block in execute_requested_actions'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/cli/execute.rb:45:in `each'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/cli/execute.rb:45:in `execute_requested_actions'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/cli/help.rb:19:in `execute_requested_actions_with_help'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/cli/execute.rb:34:in `execute!'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/lib/capistrano/cli/execute.rb:14:in `execute'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/gems/capistrano-2.14.2/bin/cap:4:in `<top (required)>'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374/bin/cap:19:in `load'
    from /Users/chriswickett/.rvm/gems/ruby-1.9.3-p374

Rails 3.2.1。

提到的manifest.yml文件包含'jquery.min.map' - 是什么'不允许映射'部分指的是什么?如果是这样,我无法弄清楚如何阻止jQuery尝试包含此映射文件。

我已经尝试将manifest.yml文件的上下文放在各种在线验证器中 - 它很好。就我所见,没有遗漏空格或标签。

谢谢!

2 个答案:

答案 0 :(得分:19)

我遇到了这个问题并删除了我在.json下的myapp/shared/assets清单文件,建议here(实际上,他们建议重命名它们,但这对我不起作用)。< / p>

答案 1 :(得分:5)

我解决了这个问题。由于Capistrano deploy/assets.rb中的文件使用YAML.load

,因此调用了Psych

它加载的变量是命令行cat命令的“捕获”,因为我的.bashrc中有一个语法错误,它正在捕获该错误的输出并将其传递给{{1也是。修复了YAML.load错误,一切都很好!