Getting errors trying to use Jekyll with Capistrano 3

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

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)

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?

Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

This question was answered by @asb:

Unfortunately, Capistrano 3 dropped :deploy_via, :copy There’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.

View the original comment