# Capistarno deployment issues

**URL:** <https://www.ruby-forum.com/t/capistarno-deployment-issues/113961>\
**Category:** Deployment\
**Created:** [September 6, 2007, 6:22pm UTC](https://www.ruby-forum.com/t/capistarno-deployment-issues/113961 "2007-09-06T18:22:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jnicholson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@jnicholson](https://www.ruby-forum.com/u/jnicholson)\
**Post date:** [September 6, 2007, 6:22pm UTC](https://www.ruby-forum.com/t/capistarno-deployment-issues/113961/1 "2007-09-06T18:22:09Z")

</div>

Hi guys,

I’ve just started using capistrano so forgive me if I’ve done something  
moronic. I’ve run capify and cap deploy:setup which all worked fine. But  
when I try to deploy my app I get the following error:

* * *

F:\personal\app\>cap deploy

- executing `deploy’
- executing `deploy:update’  
\*\* transaction: start
- executing `deploy:update\_code’
- executing “svn export -q -r6 [http://www.app.com/svn/app](http://www.app.com/svn/app)  
/home/app/releases/20070906161047 && (echo 6 \> /ho  
me/app/releases/20070906161047/REVISION)”  
servers: [“[app.com](http://app.com)”]  
Password:  
[[app.com](http://app.com)] executing command  
\*\* [out] svn: Unrecognized URL scheme for ‘[http://www.app.com/svn/app](http://www.app.com/svn/app)’  
command finished  
\*\*\* [deploy:update\_code] rolling back
- executing “rm -rf /home/app/releases/20070906161047; true”  
servers: [“[app.com](http://app.com)”]  
[[app.com](http://app.com)] executing command  
command finished  
command “svn export -q -r6 [http://www.app.com/svn/app](http://www.app.com/svn/app)  
/home/app/releases/20070906161047 && (echo 6 \> /home/fap  
box/releases/20070906161047/REVISION)” failed on [app.com](http://app.com)

* * *

Anyone have any ideas?

Cheers,

Jim

---

<div class="post-metadata">

**Author:** ![jnicholson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@jnicholson](https://www.ruby-forum.com/u/jnicholson)\
**Post date:** [September 6, 2007, 6:35pm UTC](https://www.ruby-forum.com/t/capistarno-deployment-issues/113961/2 "2007-09-06T18:35:35Z")

</div>

Wierd:

svn: Unrecognized URL scheme for ‘[http://www.app.com/svn/app](http://www.app.com/svn/app)’

That’s the error that is being reported. I’m assuming  
“[http://www.app.com/svn/app](http://www.app.com/svn/app)” is not your real SVN repository URL;  
please double- and triple-check your actual SVN repository URL to make  
sure you typed it correctly.

- Jamis

---

<div class="post-metadata">

**Author:** ![jnicholson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@jnicholson](https://www.ruby-forum.com/u/jnicholson)\
**Post date:** [September 6, 2007, 6:38pm UTC](https://www.ruby-forum.com/t/capistarno-deployment-issues/113961/3 "2007-09-06T18:38:27Z")

</div>

Hi Jamis,

The SVN repos isn’t the one listed but I’ve checked it several times and  
it’s definately the right place.

---

<div class="post-metadata">

**Author:** ![jnicholson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@jnicholson](https://www.ruby-forum.com/u/jnicholson)\
**Post date:** [September 6, 2007, 6:51pm UTC](https://www.ruby-forum.com/t/capistarno-deployment-issues/113961/4 "2007-09-06T18:51:40Z")

</div>

If you log into your remote server and type:

svn info [http://www.app.com/svn/app](http://www.app.com/svn/app)

(using your real url, of course), does it give an error?

It’s got to be something configured weird with svn. Does  
$HOME/.subversion/config have anything in it (aside from the default  
boilerplate text)?

- Jamis

---

<div class="post-metadata">

**Author:** ![jnicholson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@jnicholson](https://www.ruby-forum.com/u/jnicholson)\
**Post date:** [September 7, 2007, 11:34am UTC](https://www.ruby-forum.com/t/capistarno-deployment-issues/113961/5 "2007-09-07T11:34:05Z")

</div>

I’ve setup my deploy recipe. Although I might have missed some important  
steps as I’m new to all this jazz. Anyway here’s my deploy.rb:

* * *

set :application, “fapbox”  
set :repository, “[http://www.fapbox.com/svn/fapbox/](http://www.fapbox.com/svn/fapbox/)”  
set :deploy\_to, “/home/fapbox/”  
set :user, “root”  
set :svn\_username, “kjimn”  
set :svn\_password, “mypassword”

role :app, “[fapbox.com](http://fapbox.com)”  
role :web, “[fapbox.com](http://fapbox.com)”  
role :db, “[fapbox.com](http://fapbox.com)”, :primary =\> true

---

<div class="post-metadata">

**Author:** ![jnicholson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@jnicholson](https://www.ruby-forum.com/u/jnicholson)\
**Post date:** [September 7, 2007, 2:33pm UTC](https://www.ruby-forum.com/t/capistarno-deployment-issues/113961/6 "2007-09-07T14:33:48Z")

</div>

I think I’ve found the problem. I didn’t have neon installed. Just  
installed it now and everything seems to work brilliantly.

---

<div class="post-metadata">

**Author:** ![jnicholson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@jnicholson](https://www.ruby-forum.com/u/jnicholson)\
**Post date:** [September 6, 2007, 7:37pm UTC](https://www.ruby-forum.com/t/capistarno-deployment-issues/113961/7 "2007-09-06T19:37:50Z")

</div>

You have not configured your deployment recipe. Edit config/  
deploy.rb.

Here’s a fleshed-out example (for cap 1.4), invoked as:

cap TASK ACTION

e.g.

cap production deploy

–

# 

# Capistrano deployment

# 

# 

* * *

# acting user

# this is the login/username for your remote machines, svn repos, etc

set :user, “FOOUSER”

# svn repository config… note usage of svn+ssh, alter as necessary

# default deploy is trunk

# to specify a tag or branch:

# cap staging deploy -Sbranch=candidate-1.2.3

# cap production deploy -Stag=release-1.2.3

set :base\_repository, “svn+ssh://svn.FOOBAR.com/usr/local/repos/FOOBAR/  
site”  
if variables[:tag]  
set :repository, “#{base\_repository}/tags/#{variables[:tag]}”  
elsif variables[:branch]  
set :repository, “#{base\_repository}/branches/  
#{variables[:branch]}”  
else  
set :repository, “#{base\_repository}/trunk”  
end

# ssh options

# ssh\_options[:keys] = %w(/path/to/my/key /path/to/another/key)

# ssh\_options[:port] = 25

# 

* * *

# production and dev/staging tagets; this is how you handle

differences in paths etc…

# exa: the dev machine is a linux box, the production target is

multiple solaris zones

# hosted at joyent/textdrive

# production

task :production do  
set :application, “FOOBAR”  
set :deploy\_to, “/opt/csw/yb/#{application}/”  
set :mongrel\_conf, “/opt/csw/yb/#{application}/shared/config/  
mongrel\_cluster.yml”  
set :svn, “/opt/csw/bin/svn”  
set :sudo, “/opt/csw/bin/sudo”

```
    set :mongrel_rails, "/opt/csw/bin/mongrel_rails"

    role :web, "FOOBAR.com"
    role :app, "FOOBAR.com", "w1.FOOBAR.com", "w2.FOOBAR.com",

```

“[w3.FOOBAR.com](http://w3.FOOBAR.com)”, “[w4.FOOBAR.com](http://w4.FOOBAR.com)”, “[w5.FOOBAR.com](http://w5.FOOBAR.com)”, “[w6.FOOBAR.com](http://w6.FOOBAR.com)”,  
“[w7.FOOBAR.com](http://w7.FOOBAR.com)”  
role :db, “[FOOBAR.com](http://FOOBAR.com)”, :primary =\> true, :no\_release =\> true  
end

# dev/staging

task :stage do  
set :application, “FOOBAR”  
set :deploy\_to, “/var/rails/#{application}/”  
set :mongrel\_conf, “/var/rails/#{application}/shared/config/  
mongrel\_cluster.yml”  
set :svn, “/usr/local/bin/svn”  
set :sudo, “/usr/bin/sudo”  
set :mongrel\_rails, “/usr/local/bin/mongrel\_rails”

```
    role :web, "dev.FOOBAR.com"
    role :app, "dev.FOOBAR.com"
    role :db, "dev.FOOBAR.com", :primary =>

```

true, :no\_release=\>true  
end

# 

* * *

desc “things to do after the initial setup”  
task :after\_setup do  
run “mkdir #{shared\_path}/images”  
run “mkdir #{shared\_path}/config”  
end

desc “”  
task :before\_update\_code, :role =\> :app do  
ENV[‘REASON’] = “scheduled maintenance”  
ENV[‘UNTIL’] = (Time.now + 600).to\_s  
end

desc “things to do after the code update, before a migration and/or  
restart”  
task :after\_update\_code, :role =\> :app do

# upon first depoyment, these will not exist in shared, so we copy

them if not present in shared  
unless File.exist? “#{shared\_path}/config/backgroundrb.yml”  
run “cp #{release\_path}/config/backgroundrb.yml  
#{shared\_path}/config/backgroundrb.yml”  
end  
unless File.exist? “#{shared\_path}/config/database.yml”  
run “cp #{release\_path}/config/database.yml #{shared\_path}/  
config/database.yml”  
end  
unless File.exist? “#{shared\_path}/config/mongrel\_cluster.yml”  
run “cp #{release\_path}/config/mongrel\_cluster.yml  
#{shared\_path}/config/mongrel\_cluster.yml”  
end  
end

desc “”  
task :before\_symlink, :role =\> :app do

# solaris ln oddity(?) – subsequent symlinks wind up IN current,

not replacing it  
run “rm -f #{deploy\_to}/current”  
end

desc “after the release/current symlink is set, restore links to  
shared config files”  
task :after\_symlink, :role =\> :app do  
run “rm -f #{deploy\_to}/current/config/backgroundrb.yml”  
run “ln -s #{shared\_path}/config/backgroundrb.yml #{deploy\_to}/  
current/config/backgroundrb.yml”

run “rm -f #{deploy\_to}/current/config/mongrel\_cluster.yml”  
run “ln -s #{shared\_path}/config/mongrel\_cluster.yml #{deploy\_to}/  
current/config/mongrel\_cluster.yml”

run “rm -f #{deploy\_to}/current/config/database.yml”  
run “ln -s #{shared\_path}/config/database.yml #{deploy\_to}/current/  
config/database.yml”

end

desc “update code from svn w/o creating a new deployment… migrate  
and restart”  
task :soft\_deploy do  
transaction do  
run “cd #{deploy\_to}/current/app; #{svn} up”  
run “cd #{deploy\_to}/current/script; #{svn} up”  
run “cd #{deploy\_to}/current/public; #{svn} up”  
run “cd #{deploy\_to}/current/vendor; #{svn} up”  
run “cd #{deploy\_to}/current/lib; #{svn} up”  
run “cd #{deploy\_to}/current/db; #{svn} up”  
run “cd #{deploy\_to}/current/test; #{svn} up”  
run “cd #{deploy\_to}/current/config/; #{svn} up environment.rb”  
run “cd #{deploy\_to}/current/config/environments; #{svn} up  
production.rb”

```
migrate

```

end  
restart  
end

–

On Sep 6, 9:22 am, Jim N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
