Getting errors trying to use Jekyll with Capistrano 3

Posted January 2, 2015 4k 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

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?

1 comment

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.

Submit an Answer
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