Gemfile中的语法错误(Capistrano)

时间:2015-06-25 17:07:46

标签: ruby-on-rails syntax capistrano gemfile

卡皮斯特拉诺给我一个错误,说我在错误的地方放了一个冒号,我甚至没有。我该怎么做才能解决这个问题?我猜测只需指定sdoc即可,但我不确定正确的语法是什么。 gem 'sdoc', '~> 0.4.0'失败。

错误:(求和)

(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as haldenkr@weareamnesia.com: 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"

完整的错误文字:

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 haldenkr@weareamnesia.com: 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 haldenkr@weareamnesia.com: 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 个答案:

答案 0 :(得分:0)

加入Gemfile

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

然后bundle install

答案 1 :(得分:0)

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.