Я пытаюсь развернуть сайт helloworld с моего локального компьютера на сервер. Я установил Ruby, Rails и Capistrano. Получив рецепт, я набираю команду «cap deploy: setup» и получаю следующую ошибку
/ USR / Библиотека / рубин / 1.8 / Capistrano / конфигурации / variables.rb: 122: в
method_missing': undefined local variable or method
основной 'для
(NameError) из ./config/deploy.rb:19:in `load 'из
/ USR / Библиотека / рубин / 1.8 / Capistrano / конфигурации / loading.rb: 172: в
load_from_file' from
/usr/lib/ruby/1.8/capistrano/configuration/loading.rb:89:in
нагрузка»
из /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in
load' from
/usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in
каждый»
из /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in
load' from Capfile:4:in
загрузить 'из
/usr/lib/ruby/1.8/capistrano/configuration/loading.rb:172:in
load_from_file' from
/usr/lib/ruby/1.8/capistrano/configuration/loading.rb:89:in
нагрузка»
из /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in
load' from
/usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in
каждый»
из /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in
load' from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:64:in
load_recipes 'из /usr/lib/ruby/1.8/capistrano/cli/execute.rb:64:in
each' from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:64:in
load_recipes 'из /usr/lib/ruby/1.8/capistrano/cli/execute.rb:30:in
execute!' from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:14:in
выполнить 'из / usr / bin / cap: 4
Ниже приведено содержимое моего файла deploy.rb.
set :application, "testapp"
set :repository, "<url of git repo>"
set :deploy_to, "var/www/html/testapp"
set :document_root, "var/www/html/testapp/current"
set :scm, :git
set :scm_username, "MyUserName"
set :scm_password, "MyPassword"
set :scm_checkout, "clone"
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
set :user, "<server's user name>"
set :password, "<server's password>"
set :use_sudo, false
set :ssh_options, {:forward_agent => true}
role :web, "<server's IP>" # Your HTTP server, Apache/etc
role :app, "<server's IP>" # This may be the same as your `Web` server
role :db, "<server's IP>", primary => true # This is where Rails migrations will run
# If you are using Passenger mod_rails uncomment this:
# if you're still using the script/reapear helper you will need
# these http://github.com/rails/irs_process_scripts
# namespace :deploy do
# task :start {}
# task :stop {}
# task :restart, :roles => :app, :except => { :no_release => true } do
# run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
# end
# end
namespace :deploy do
task :update do
transaction do
update_code
symlink
end
end
task :finalize_update do
transaction do
end
end
task :symlink do
transaction do
run "ln -nfs #{current_release} #{deploy_to}/#{current_dir}"
run "ln -nfs #{deploy_to}/#{current_dir} #{document_root}"
end
end
task :migrate do
end
task :restart do
end
end