Skip to content

Rails 4 with Capistrano v3 broken my app #582

Closed
chunlea opened this Issue Jul 30, 2013 · 6 comments

3 participants

@chunlea
chunlea commented Jul 30, 2013

I add

# Use Capistrano for deployment
gem 'capistrano', github: 'capistrano/capistrano', :branch => 'v3', group: :development
gem 'capistrano-rails', '~>0.0.7', group: :development

to my new rails 4 project. But I got an error when I visit my app.
Here is the log files

Started GET "/" for 127.0.0.1 at 2013-07-30 13:30:15 +0800
Processing by WelcomeController#index as HTML
  Rendered welcome/index.html.slim within layouts/application (5.8ms)
Completed 500 Internal Server Error in 9ms

ActionView::Template::Error (no implicit conversion of String into Hash):
  sshkit (0.0.34) lib/sshkit/coordinator.rb:14:in `merge'
  sshkit (0.0.34) lib/sshkit/coordinator.rb:14:in `each'
  sshkit (0.0.34) lib/sshkit/dsl.rb:8:in `on'
  (eval):49:in `dispatcher'
  temple (0.6.5) lib/temple/mixins/dispatcher.rb:49:in `compile'
  temple (0.6.5) lib/temple/html/dispatcher.rb:10:in `on_html_attr'
  (eval):22:in `dispatcher'
  temple (0.6.5) lib/temple/mixins/dispatcher.rb:49:in `compile'
  temple (0.6.5) lib/temple/html/dispatcher.rb:6:in `block in on_html_attrs'
  temple (0.6.5) lib/temple/html/dispatcher.rb:6:in `map'
  temple (0.6.5) lib/temple/html/dispatcher.rb:6:in `on_html_attrs'
  (eval):20:in `dispatcher'
  temple (0.6.5) lib/temple/mixins/dispatcher.rb:49:in `compile'
  temple (0.6.5) lib/temple/html/dispatcher.rb:26:in `on_html_tag'
  (eval):30:in `dispatcher'
  temple (0.6.5) lib/temple/mixins/dispatcher.rb:49:in `compile'
  temple (0.6.5) lib/temple/mixins/dispatcher.rb:7:in `block in on_multi'
  temple (0.6.5) lib/temple/mixins/dispatcher.rb:7:in `each'
  temple (0.6.5) lib/temple/mixins/dispatcher.rb:7:in `on_multi'
  (eval):45:in `dispatcher'
  temple (0.6.5) lib/temple/mixins/dispatcher.rb:49:in `compile'
  temple (0.6.5) lib/temple/mixins/dispatcher.rb:45:in `call'
  temple (0.6.5) lib/temple/engine.rb:50:in `block in call'
  temple (0.6.5) lib/temple/engine.rb:50:in `each'
  temple (0.6.5) lib/temple/engine.rb:50:in `inject'
  temple (0.6.5) lib/temple/engine.rb:50:in `call'
  temple (0.6.5) lib/temple/mixins/template.rb:10:in `compile'
  temple (0.6.5) lib/temple/templates/rails.rb:34:in `call'
  actionpack (4.0.0) lib/action_view/template.rb:272:in `compile'
  actionpack (4.0.0) lib/action_view/template.rb:248:in `block in compile!'
  actionpack (4.0.0) lib/action_view/template.rb:236:in `synchronize'
  actionpack (4.0.0) lib/action_view/template.rb:236:in `compile!'
  actionpack (4.0.0) lib/action_view/template.rb:142:in `block in render'
  activesupport (4.0.0) lib/active_support/notifications.rb:161:in `instrument'
  actionpack (4.0.0) lib/action_view/template.rb:141:in `render'
  actionpack (4.0.0) lib/action_view/renderer/template_renderer.rb:49:in `block (2 levels) in render_template'
  actionpack (4.0.0) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
  activesupport (4.0.0) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.0.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.0.0) lib/active_support/notifications.rb:159:in `instrument'
  actionpack (4.0.0) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
  actionpack (4.0.0) lib/action_view/renderer/template_renderer.rb:48:in `block in render_template'
  actionpack (4.0.0) lib/action_view/renderer/template_renderer.rb:56:in `render_with_layout'
  actionpack (4.0.0) lib/action_view/renderer/template_renderer.rb:47:in `render_template'
  actionpack (4.0.0) lib/action_view/renderer/template_renderer.rb:17:in `render'
  actionpack (4.0.0) lib/action_view/renderer/renderer.rb:42:in `render_template'
  actionpack (4.0.0) lib/action_view/renderer/renderer.rb:23:in `render'
  actionpack (4.0.0) lib/abstract_controller/rendering.rb:127:in `_render_template'
  actionpack (4.0.0) lib/action_controller/metal/streaming.rb:219:in `_render_template'
  actionpack (4.0.0) lib/abstract_controller/rendering.rb:120:in `render_to_body'
  actionpack (4.0.0) lib/action_controller/metal/rendering.rb:33:in `render_to_body'
  actionpack (4.0.0) lib/action_controller/metal/renderers.rb:26:in `render_to_body'
  actionpack (4.0.0) lib/abstract_controller/rendering.rb:97:in `render'
  actionpack (4.0.0) lib/action_controller/metal/rendering.rb:16:in `render'
  actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
  activesupport (4.0.0) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
  /Users/chunlea/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
  activesupport (4.0.0) lib/active_support/core_ext/benchmark.rb:12:in `ms'
  actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
  actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
  actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:40:in `render'
  actionpack (4.0.0) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
  actionpack (4.0.0) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
  actionpack (4.0.0) lib/abstract_controller/base.rb:189:in `process_action'
  actionpack (4.0.0) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (4.0.0) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  activesupport (4.0.0) lib/active_support/callbacks.rb:403:in `_run__8023214907671754__process_action__callbacks'
  activesupport (4.0.0) lib/active_support/callbacks.rb:80:in `run_callbacks'
  actionpack (4.0.0) lib/abstract_controller/callbacks.rb:17:in `process_action'
  actionpack (4.0.0) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
  activesupport (4.0.0) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.0.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.0.0) lib/active_support/notifications.rb:159:in `instrument'
  actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (4.0.0) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
  actionpack (4.0.0) lib/abstract_controller/base.rb:136:in `process'
  actionpack (4.0.0) lib/abstract_controller/rendering.rb:44:in `process'
  actionpack (4.0.0) lib/action_controller/metal.rb:195:in `dispatch'
  actionpack (4.0.0) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  actionpack (4.0.0) lib/action_controller/metal.rb:231:in `block in action'
  actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:80:in `call'
  actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
  actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:48:in `call'
  actionpack (4.0.0) lib/action_dispatch/journey/router.rb:71:in `block in call'
  actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in `each'
  actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in `call'
  actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:655:in `call'
  omniauth (1.1.4) lib/omniauth/strategy.rb:184:in `call!'
  omniauth (1.1.4) lib/omniauth/strategy.rb:164:in `call'
  /Users/chunlea/.rvm/gems/ruby-2.0.0-p247/bundler/gems/mongoid-5d8397e24b67/lib/rack/mongoid/middleware/identity_map.rb:34:in `block in call'
  /Users/chunlea/.rvm/gems/ruby-2.0.0-p247/bundler/gems/mongoid-5d8397e24b67/lib/mongoid/unit_of_work.rb:39:in `unit_of_work'
  /Users/chunlea/.rvm/gems/ruby-2.0.0-p247/bundler/gems/mongoid-5d8397e24b67/lib/rack/mongoid/middleware/identity_map.rb:34:in `call'
  warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.3) lib/warden/manager.rb:34:in `catch'
  warden (1.2.3) lib/warden/manager.rb:34:in `call'
  rack (1.5.2) lib/rack/etag.rb:23:in `call'
  rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
  rack (1.5.2) lib/rack/head.rb:11:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/flash.rb:241:in `call'
  rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
  rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/cookies.rb:486:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.0.0) lib/active_support/callbacks.rb:373:in `_run__55471011385078050__call__callbacks'
  activesupport (4.0.0) lib/active_support/callbacks.rb:80:in `run_callbacks'
  actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/reloader.rb:64:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.0.0) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.0.0) lib/rails/rack/logger.rb:21:in `block in call'
  activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `block in tagged'
  activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:in `tagged'
  activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `tagged'
  railties (4.0.0) lib/rails/rack/logger.rb:21:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.2) lib/rack/runtime.rb:17:in `call'
  activesupport (4.0.0) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
  rack (1.5.2) lib/rack/lock.rb:17:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/static.rb:64:in `call'
  railties (4.0.0) lib/rails/engine.rb:511:in `call'
  railties (4.0.0) lib/rails/application.rb:97:in `call'
  /Users/chunlea/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:145:in `handle'
  /Users/chunlea/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:99:in `rescue in block (2 levels) in start'
  /Users/chunlea/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:96:in `block (2 levels) in start'
  /Users/chunlea/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:86:in `each'
  /Users/chunlea/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:86:in `block in start'
  /Users/chunlea/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:66:in `loop'
  /Users/chunlea/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:66:in `start'
  /Users/chunlea/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:13:in `run'
  /Users/chunlea/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/bin/nack_worker:4:in `<main>'


  Rendered /Users/chunlea/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (6.3ms)

After I delete capistrano from my Gemfile and bundle again, the app work fine.

BTW. It seems that Capistrano 2.x works fine. I use Ruby 2.0.0 and rails 4 on OSX 10.9 DP4

@leehambley
Capistrano member

gem 'capistrano', github: 'capistrano/capistrano', :branch => 'v3', group: :development

Try:

gem 'capistrano', github: 'capistrano/capistrano', :branch => 'v3', group: :development, require: false

Better yet, just use the Gem from rubygems.org:

group :development do
  gem 'capistrano', '~> 3.0.0.pre', require: false
end

In any case the require: false is important

@leehambley
Capistrano member

/cc @epipheus

@epipheus
@leehambley
Capistrano member

Yep, if you have capistrano-rails then you shouldn't need capistrano itself.

@epipheus

Please change the docs for capistrano-rails then which says to include both in the Gemfile.

gem 'capistrano', version: '~> 3.0.0'
gem 'capistrano-rails', version: '~> 1.0.0'

But huge thank you for cc'ing me. I wouldn't have thought of a Gemfile solution at all!!

@chunlea
chunlea commented Aug 1, 2013

Thank you so much. @leehambley . It works fine for me.

@chunlea chunlea closed this Aug 1, 2013
@seenmyfate seenmyfate added a commit that referenced this issue Sep 13, 2013
@seenmyfate seenmyfate Move requires to `capistrano/all`
This removes the need to set `require: false` in your Gemfile. Should
prevent the issues described in #582 reoccurring.

(also capistrano/rails#15)
447e4ce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.