getting capistrano to work

48 views
Skip to first unread message

ruud

unread,
Jun 25, 2014, 4:35:13 AM6/25/14
to capis...@googlegroups.com
Versions:
  • Ruby 1.9.2
  • Capistrano3.0.1
  • (Rake Version: 10.3.2

hello group,
I just wanted to get the basics of capistrano to understand how and if I can use it for my project.

However, I am reading and trying for quite some time and I have not created a single capfile that did anything without stacktraces. Can you please assist me so that I can get started?

Based on a very basic tutorial, my capfile contains right now:

set :username, "ruud"
set :host, "localhost"

desc "simple test"
task :search, :hosts => "#{username}@#{host}" do
      run "ls -x1 /usr/lib | grep -i xml"
end


and cap reports me this:
SZ cap search
cap aborted!
NameError: undefined local variable or method `username' for main:Object
/data/ruby/capistrano/capfile:1:in `<top (required)>'
/export/home/rdgon/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-3.0.1/lib/capistrano/application.rb:22:in `load_rakefile'

Do you know what I am missing?
Maybe I am not using the right tutorial. If someone can recommend me a step by step tutorial for understanding the basics, I would be very grateful.

Ruud

Lee Hambley

unread,
Jun 25, 2014, 8:18:18 AM6/25/14
to capistrano

Use fetch(:username), and then ask yourself why you are using capistrano helpers, for normal variables :-) chef Google for "sshkit examples" probably a better place to start

Sent from my Nexus 5.

--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/878e6ed0-a28c-4e27-9a73-f7bd5cec1d97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Haani Niyaz

unread,
Jun 26, 2014, 9:40:35 PM6/26/14
to capis...@googlegroups.com
Here's a tutorial I wrote for my team:

ruud

unread,
Jul 1, 2014, 4:45:49 AM7/1/14
to capis...@googlegroups.com
Hi Haani,
thanks for the tutorial. Very helpful. Still got some things that are somewhat not working as expected, but that is part of the learning process ;)

Ruud
Reply all
Reply to author
Forward
0 new messages