Syntax Error within Gemfile (Capistrano)

225 views Asked by At

Capistrano's giving me an error saying that I have a colon in the wrong place for a gem that I don't even have. What should I do to resolve this? I'm guessing simply specifying sdoc will work, but I'm not sure what the correct syntax is. gem 'sdoc', '~> 0.4.0' fails.

The error: (summation)

(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: bundle exit status: 4
bundle stdout: Gemfile syntax error:
/home/haldenkr/public_html/qwestera/releases/20150625170018/Gemfile:11: syntax
error, unexpected ':', expecting $end
gem 'sdoc', '~> 0.4.0', group: :doc
                              ^
bundle stderr: Nothing written

Gemfile

source 'https://rubygems.org'

gem 'rails', '4.2.1'
gem 'pg'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'byebug'
gem 'web-console', '~> 2.0'
gem 'spring'
gem 'devise'
gem 'bootstrap-sass'
gem 'autoprefixer-rails'
gem 'mailcatcher'
gem 'rails_12factor'
gem 'capistrano'
gem 'capistrano-passenger'
gem 'capistrano-rails'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

ruby "2.2.2"

The full error text:

DEBUG [697ff6d6]    Gemfile syntax error:
DEBUG [697ff6d6]    /home/haldenkr/public_html/qwestera/releases/20150625180749/Gemfile:11: syntax
DEBUG [697ff6d6]    error, unexpected ':', expecting $end
DEBUG [697ff6d6]    gem 'sdoc', '~> 0.4.0', group: :doc
DEBUG [697ff6d6]                                  ^
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: bundle exit status: 4
bundle stdout: Gemfile syntax error:
/home/haldenkr/public_html/qwestera/releases/20150625180749/Gemfile:11: syntax
error, unexpected ':', expecting $end
gem 'sdoc', '~> 0.4.0', group: :doc
                              ^
bundle stderr: Nothing written

SSHKit::Command::Failed: bundle exit status: 4
bundle stdout: Gemfile syntax error:
/home/haldenkr/public_html/qwestera/releases/20150625180749/Gemfile:11: syntax
error, unexpected ':', expecting $end
gem 'sdoc', '~> 0.4.0', group: :doc
                              ^
bundle stderr: Nothing written

Tasks: TOP => deploy:updated => bundler:install
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as [email protected]: bundle exit status: 4
bundle stdout: Gemfile syntax error:
/home/haldenkr/public_html/qwestera/releases/20150625180749/Gemfile:11: syntax
error, unexpected ':', expecting $end
gem 'sdoc', '~> 0.4.0', group: :doc
                              ^
bundle stderr: Nothing written
2

There are 2 answers

0
jmdeldin On

Since your remote server is running Ruby < 1.9, change your Gemfile to

gem 'sdoc', '~> 0.4.0', :group => :doc

However, please change to a Ruby 2.2+ host immediately -- 1.8.7 is not supported and is very slow.

1
Prashant4224 On

Add in Gemfile

group :doc do
  gem 'sdoc', require: false
end

Then bundle install