Capifony:语法错误,意外的tLABEL,期待keyword_do或'{'或'(''

时间:2013-05-09 06:20:34

标签: ruby symfony capistrano capifony

我正在尝试让Capifony在我的Symfony2应用程序中工作,而对于我的生活,我无法让它工作,因为我真的不知道如何调试ruby。这就是我在做的事情:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.10
Release:        12.10
Codename:       quantal

$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
$ gem -v
2.0.3
$ gem list

*** LOCAL GEMS ***

capifony (2.2.8)
capistrano (2.15.4, 2.14.2)
capistrano-maintenance (0.0.3, 0.0.2)
colored (1.2)
highline (1.6.18)
inifile (2.0.2)
net-scp (1.1.0)
net-sftp (2.1.2)
net-ssh (2.6.7)
net-ssh-gateway (1.2.0)
rubygems-update (2.0.3)

$ capifony .
[add] writing './Capfile'
[add] writing './app/config/deploy.rb'
[done] symfony 2 project capifonied!

$ cap deploy
/usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/lib/capistrano/configuration/loading.rb:93:in `instance_eval': deploy:3: syntax error, unexpected tLABEL, expecting keyword_do or '{' or '(' (SyntaxError)
php app/console assets:install web
                       ^
deploy:4: syntax error, unexpected tLABEL, expecting keyword_do or '{' or '('
php app/console cache:clear
                      ^
deploy:5: syntax error, unexpected tLABEL, expecting keyword_do or '{' or '('
php app/console cache:clear --env=prod --no-debug
                      ^
deploy:5: syntax error, unexpected tUMINUS, expecting keyword_do or '{' or '('
php app/console cache:clear --env=prod --no-debug
                                        ^
deploy:7: syntax error, unexpected tLABEL, expecting keyword_do or '{' or '('
php app/console assetic:dump
                        ^
deploy:8: syntax error, unexpected tLABEL, expecting keyword_do or '{' or '('
php app/console assetic:dump --env=prod --no-debug
                        ^
deploy:8: syntax error, unexpected tUMINUS, expecting keyword_do or '{' or '('
php app/console assetic:dump --env=prod --no-debug
                                         ^
        from /usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/lib/capistrano/configuration/loading.rb:93:in `load'
        from /usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/lib/capistrano/configuration/loading.rb:172:in `load_from_file'
        from /usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/lib/capistrano/configuration/loading.rb:89:in `load'
        from /usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/lib/capistrano/configuration/loading.rb:86:in `block in load'
        from /usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/lib/capistrano/configuration/loading.rb:86:in `each'
        from /usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/lib/capistrano/configuration/loading.rb:86:in `load'
        from Capfile:1:in `load'
        from /usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
        from /usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/lib/capistrano/configuration/loading.rb:93:in `load'
        from /usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/lib/capistrano/configuration/loading.rb:172:in `load_from_file'
        from /usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/lib/capistrano/configuration/loading.rb:89:in `load'
        from /usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/lib/capistrano/configuration/loading.rb:86:in `block in load'
        from /usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/lib/capistrano/configuration/loading.rb:86:in `each'
        from /usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/lib/capistrano/configuration/loading.rb:86:in `load'
        from /usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/lib/capistrano/cli/execute.rb:65:in `block in load_recipes'
        from /usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/lib/capistrano/cli/execute.rb:65:in `each'
        from /usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/lib/capistrano/cli/execute.rb:65:in `load_recipes'
        from /usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/lib/capistrano/cli/execute.rb:31:in `execute!'
        from /usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/lib/capistrano/cli/execute.rb:14:in `execute'
        from /usr/lib/ruby/gems/1.9.1/gems/capistrano-2.15.4/bin/cap:4:in `<top (required)>'
        from /usr/local/bin/cap:23:in `load'
        from /usr/local/bin/cap:23:in `<main>'

我意识到我没有触及deploy.rb,但这是因为无论我做什么,我都会遇到同样的错误。有任何想法吗?非常感谢。

1 个答案:

答案 0 :(得分:1)

为了解决这个问题,我卸载了ruby和所有宝石,然后使用rvm安装了ruby 1.8.7并重新安装了capifony。我认为capifony目前与ruby的1.9。*分支不兼容。