I am working with Capistrano to automate deployment of a PHP Zend framework application. I have made some progress but one error is totally stumped me. All examples of capistrano recipes I can find are using the same URl style (example here http://ryanflorence.com/deploying-with-capistrano-without-rails/)
In my deploy.rb I set the repository URL as below
set :repository, "ssh://git@github.com/satyamagarwala/app.git"
I get this error which seems to be originating from the above line
/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>'
I saw this thread syntax error, unexpected ':' which is talking about how a : might be mistaken for a separator. I tried putting the git URL with parentheses but that does not seem to work.
Appreciate the help!
Satyam
Edit
I went on a limb and tried the following
set :repository, "abcd"
and it gave me exactly the same error, which makes me think it is not a syntax issue associated with colon. Not sure what the problem is.
Ok, this might sound ridiculous (I have been battling with this for the past three hours so believe me I am a little taken aback right now).
This line was copied over from a webpage
and the space after the , seems to the problem. I just happened to remove it and type it again and seems like it solved the problem. I have reproduced the effect multiple times by using undo/redo. Pretty sure it is that. My entire script is working as expected now.
Is it possible there was some sort of hidden character there? If someone has an explanation for it I would love to know what was happening.