我正在与Capistrano合作,自动部署PHP Zend框架应用程序。我已经取得了一些进展但是一个错误完全让我难过。我能找到的所有capistrano食谱的例子都使用相同的URl风格(例如http://ryanflorence.com/deploying-with-capistrano-without-rails/)
在我的deploy.rb中,我将存储库URL设置如下
set :repository, "ssh://git@github.com/satyamagarwala/app.git"
我收到此错误,似乎是源于上述行
/Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/lib/capistrano/configuration/loading.rb:93:in `instance_eval': ./config/deploy.rb:12: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' (SyntaxError)
set :repository, "ssh://git@github.com/satyamagarwala...
^
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/lib/capistrano/configuration/loading.rb:93:in `load'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/lib/capistrano/configuration/loading.rb:172:in `load_from_file'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/lib/capistrano/configuration/loading.rb:89:in `load'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/lib/capistrano/configuration/loading.rb:86:in `block in load'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/lib/capistrano/configuration/loading.rb:86:in `each'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/lib/capistrano/configuration/loading.rb:86:in `load'
from Capfile:5:in `load'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/lib/capistrano/configuration/loading.rb:93:in `load'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/lib/capistrano/configuration/loading.rb:172:in `load_from_file'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/lib/capistrano/configuration/loading.rb:89:in `load'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/lib/capistrano/configuration/loading.rb:86:in `block in load'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/lib/capistrano/configuration/loading.rb:86:in `each'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/lib/capistrano/configuration/loading.rb:86:in `load'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/lib/capistrano/cli/execute.rb:65:in `block in load_recipes'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/lib/capistrano/cli/execute.rb:65:in `each'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/lib/capistrano/cli/execute.rb:65:in `load_recipes'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/lib/capistrano/cli/execute.rb:31:in `execute!'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/lib/capistrano/cli/execute.rb:14:in `execute'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/gems/capistrano-2.11.2/bin/cap:4:in `<top (required)>'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/bin/cap:19:in `load'
from /Users/satyam/.rvm/gems/ruby-1.9.2-p180/bin/cap:19:in `<main>'
我看到这个帖子syntax error, unexpected ':'正在谈论a:怎么可能被误认为是分隔符。我尝试将git URL放在括号中,但这似乎不起作用。
感谢帮助!
萨特雅姆
修改
我继续尝试以下
set :repository, "abcd"
它给了我完全相同的错误,这让我觉得它不是与冒号相关的语法问题。不确定是什么问题。
答案 0 :(得分:1)
好吧,这可能听起来很荒谬(过去三个小时我一直在与此作斗争,所以相信我,我现在有点吃惊)。
此行已从网页
复制set :repository, "ssh://git@github.com/satyamagarwala/app.git"
似乎问题出在后面的空间。我刚刚删除它并再次键入它,似乎它解决了问题。我使用undo / redo多次重现了这个效果。很确定就是这样。我的整个脚本现在按预期工作了。
那里有可能存在某种隐藏的角色吗?如果有人对此有解释,我很想知道发生了什么。
答案 1 :(得分:0)
您可以移除ssh://
,它仍然可以使用。