The tutorial is for Capistrano 2, and a lot of the commands return errors. Currently, I’m struggling in the the deploy.rb file. Here’s what I’ve got…
# config valid only for current version of Capistrano
lock '3.3.5'
set :application, "Personal Site"
set :repository, '_site'
set :scm, :none
set :deploy_via, :copy
set :copy_compression, :gzip
set :use_sudo, false
# Default deploy_to directory is /var/www/my_app_name
set :deploy_to, '*redacted*'
# the name of the user that should be used for deployments on your VPS
set :user, "chris"
# the ip address of your VPS
role :web, "*redacted*"
before 'deploy:update', 'deploy:update_jekyll'
namespace :deploy do
[:start, :stop, :restart, :finalize_update].each do |t|
desc "#{t} task is a no-op with jekyll"
task t, :roles => :app do ; end
end
desc 'Run jekyll to update site before uploading'
task :update_jekyll do
# clear existing _site
# build site using jekyll
# remove Capistrano stuff from build
%x(rm -rf _site/* && jekyll build && rm _site/Capfile && rm -rf _site/config)
end
end
This is my error :
CDavis-MBP% cap staging deploy
(Backtrace restricted to imported tasks)
cap aborted!
NoMethodError: undefined method `map' for :roles:Symbol
Tasks: TOP => staging
(See full trace by running task with --trace)
Any help?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This question was answered by @asb:
Unfortunately, Capistrano 3 dropped
:deploy_via, :copyThere’s some discussion in this GitHub issue. Do you maintain this in a git repository somewhere? If so, then Capistrano will still be a good fit. If not, you might need to look at other options.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.