Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

capistrano error when deploying with namespace

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.

like image 943
DGM Avatar asked May 24 '26 09:05

DGM


1 Answers

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.

like image 128
Peter Hoeg Avatar answered May 25 '26 22:05

Peter Hoeg