Variables not set / interpolating into strings?

91 views
Skip to first unread message

Gilbert Sinnott

unread,
Mar 5, 2014, 7:11:06 AM3/5/14
to capis...@googlegroups.com
Hi there,

These are the first lines of my deploy.rb file:

set :user, 'gs'
set :domain, 'domain.com'
set :project, 'myproject'
set :application, 'myproject.com'
set :applicationdir, "/home/#{user}/#{application}"

Logs:
  • undefined local variable or method `user' for main:Object
Versions:
  • ruby-2.0.0-p353
  • Capistrano 3.1
  • Rails 4

Really strange - I've experimented setting/calling other variables but can't seem to access them?

Lee Hambley

unread,
Mar 5, 2014, 7:18:51 AM3/5/14
to capistrano
If you have found that documented somwehere, it is wrong.

set :applicationdir, "/home/#{
​fetch(:​
user
​)​
}/#{
​fetch(:​
application
​)​
}"

​is how it should be.​



--
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/b2cd036d-d36f-45e6-86c9-04ba0186378d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Gilbert Sinnott

unread,
Mar 5, 2014, 8:39:11 AM3/5/14
to capis...@googlegroups.com
Great, thank you!

Do I need to run fetch for the shh_options? I am getting undefined here too...

Lee Hambley

unread,
Mar 5, 2014, 8:51:24 AM3/5/14
to capistrano

If set with set() it must be fetched with fetch()

Sent from my Nexus 4.

Reply all
Reply to author
Forward
0 new messages