使用命名空间部署时发生 capistrano 错误

发布于 2024-12-18 00:30:08 字数 705 浏览 0 评论 0原文

我的 cap deploy:migrate 突然停止工作,并出现错误:

*** [err :: 1.2.3.4:2222] bash: -c: line 1: syntax error: unexpected end of file command finished in 559ms
failed: "/usr/local/bin/rvm-shell 'ruby-1.9.2-p0@gemset' -c 'cd /home/user/app/releases/20111122182205 && #<Capistrano::Configuration::Namespaces::Namespace:0xa6a0cc> RAILS_ENV=staging  db:migrate'" on 1.2.3.4:2222

显然该错误与这不是有效的命令有关... #

但我不知道最近发生了什么变化可能导致它。有什么想法吗?

更新

我不知道我的代码没有任何改变,但我可能修改了环境。我想知道这是否可能是由于不同的宝石组和卡皮斯特拉诺版本造成的。似乎有和没有捆绑执行调用之间存在不同的版本。

My cap deploy:migrate has suddenly stopped working, with an error:

*** [err :: 1.2.3.4:2222] bash: -c: line 1: syntax error: unexpected end of file command finished in 559ms
failed: "/usr/local/bin/rvm-shell 'ruby-1.9.2-p0@gemset' -c 'cd /home/user/app/releases/20111122182205 && #<Capistrano::Configuration::Namespaces::Namespace:0xa6a0cc> RAILS_ENV=staging  db:migrate'" on 1.2.3.4:2222

Obviously the error has something to do with this not being a valid command ... #<Capistrano::Configuration::Namespaces::Namespace:0xa6a0cc>

But I have no idea what changed recently that could cause it. Any ideas?

update

I know nothing of my code changed, but I may have fiddled with environments. I'm wondering if it could be due to different gemsets and versions of capistrano. It appears like different versions exist between with and without bundle exec calls.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

绅刃 2024-12-25 00:30:08

我遇到了完全相同的问题,就我而言,它与命名空间和变量之间的冲突有关。基本上,发生的事情是:

set :user, 'some user'

namespace :user do ;因此

,每当我尝试引用用户变量时,我都会获取命名空间。我将命名空间:用户更改为命名空间:用户,一切都很好。

最终解决方案 (由OP编辑)

这几乎是赚钱的。资产管道代码包括对 #{rake} 的调用,这与我为在远程服务器上运行代码而选择的配方相冲突,该配方具有 namespace :rake 行。更改我的 rake 命名空间解决了问题。

I had this exact same problem and in my case it was related to a clash between a namespace and a variable. Basically, what happened was:

set :user, 'some user'

namespace :user do ; end

So whenever I was trying to reference the user variable I instead would be getting the namespace. I changed namespace :user to namespace :users and it's all good.

final solution (edited by OP)

This was nearly on the money. The asset pipeline code included a call to #{rake} which conflicted with a recipe I had picked up for running code on the remote server, which had a namespace :rake line. Changing my rake namespace fixed the problem.

方圜几里 2024-12-25 00:30:08

意外的文件结束错误通常是由于未关闭块或括号等运算符而发生的。或者您可能在命名空间块中缺少 do。您应该仔细检查语法是否有任何可能未正确关闭的内容。

如果您在校对配置后没有发现错误,那么如果您可以使用deploy.rb 配置更新问题,将会有所帮助。

Unexpected end of file errors typically occur from not closing a block or operators like parentheses. Or you may be missing the do in a namespace block. You should double check your syntax for anything that may not have been closed properly.

If you don't spot the error after proofreading the configuration it will help if you can update the question with your deploy.rb configuration.

夜唯美灬不弃 2024-12-25 00:30:08

写入#{Capistrano::Configuration::Namespaces::Namespace:0xa6a0cc}

Write #{Capistrano::Configuration::Namespaces::Namespace:0xa6a0cc}

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文