Getting errors trying to use Jekyll with Capistrano 3

January 2, 2015 3.7k views

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?

1 comment
  • 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.

1 Answer

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

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!