How to customize devise reset password mailer in rails? - email

I have tried the following code snippet to customize the reset password in case of devise
class CustomMailer < Devise::Mailer
helper :application # gives access to all helpers defined within `application_helper`.
include Devise::Controllers::UrlHelpers # Optional. eg. `confirmation_url`
default template_path: 'devise/mailer' # to make sure that your mailer uses the devise views
def reset_password_instructions(record, token, opts={})
#resource = record
mail(:to => "#{#resource.full_name} <#{#resource.email}>", :subject => "Reset password instructions", :tag => 'password-reset', :content_type => "text/html") do |format|
format.html { render "devise/mailer/reset_password_instructions" }
end
end
end
and defining in Devise.rb as
config.mailer = 'CustomMailer'
Which works perfectly fine on local machine / dev env but in production I am getting an error like :
ArgumentError (An SMTP From address is required to send a message. Set the message smtp_envelope_from, return_path, sender, or from address.):
vendor/bundle/ruby/2.0.0/gems/mail-2.6.1/lib/mail/check_delivery_params.rb:5:in `check_delivery_params'
vendor/bundle/ruby/2.0.0/gems/mail-2.6.1/lib/mail/network/delivery_methods/smtp.rb:98:in `deliver!'
vendor/bundle/ruby/2.0.0/gems/mail-2.6.1/lib/mail/message.rb:2136:in `do_delivery'
vendor/bundle/ruby/2.0.0/gems/mail-2.6.1/lib/mail/message.rb:232:in `block in deliver'
vendor/bundle/ruby/2.0.0/gems/actionmailer-4.1.6/lib/action_mailer/base.rb:527:in `block in deliver_mail'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/notifications.rb:159:in `block in instrument'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/notifications.rb:159:in `instrument'
vendor/bundle/ruby/2.0.0/gems/actionmailer-4.1.6/lib/action_mailer/base.rb:525:in `deliver_mail'
vendor/bundle/ruby/2.0.0/gems/mail-2.6.1/lib/mail/message.rb:232:in `deliver'
vendor/bundle/ruby/2.0.0/gems/devise-3.3.0/lib/devise/models/authenticatable.rb:173:in `send_devise_notification'
vendor/bundle/ruby/2.0.0/gems/devise-3.3.0/lib/devise/models/recoverable.rb:99:in `send_reset_password_instructions_notification'
vendor/bundle/ruby/2.0.0/gems/devise-3.3.0/lib/devise/models/recoverable.rb:49:in `send_reset_password_instructions'
vendor/bundle/ruby/2.0.0/gems/devise-3.3.0/lib/devise/models/recoverable.rb:116:in `send_reset_password_instructions'
vendor/bundle/ruby/2.0.0/gems/devise-3.3.0/app/controllers/devise/passwords_controller.rb:13:in `create'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/abstract_controller/base.rb:189:in `process_action'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_controller/metal/rendering.rb:10:in `process_action'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:113:in `call'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:113:in `call'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:229:in `call'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:229:in `block in halting'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:149:in `call'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:166:in `call'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:166:in `block in halting'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:229:in `call'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:229:in `block in halting'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:166:in `call'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:166:in `block in halting'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:166:in `call'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:166:in `block in halting'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:166:in `call'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:166:in `block in halting'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:86:in `call'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:86:in `run_callbacks'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/abstract_controller/callbacks.rb:19:in `process_action'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_controller/metal/rescue.rb:29:in `process_action'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/notifications.rb:159:in `block in instrument'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/notifications.rb:159:in `instrument'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/abstract_controller/base.rb:136:in `process'
vendor/bundle/ruby/2.0.0/gems/actionview-4.1.6/lib/action_view/rendering.rb:30:in `process'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_controller/metal.rb:196:in `dispatch'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_controller/metal.rb:232:in `block in action'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/routing/route_set.rb:82:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/routing/route_set.rb:50:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/routing/mapper.rb:45:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/journey/router.rb:73:in `block in call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/journey/router.rb:59:in `each'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/journey/router.rb:59:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/routing/route_set.rb:678:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-attack-4.2.0/lib/rack/attack.rb:104:in `call'
vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:35:in `block in call'
vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `catch'
vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/conditionalget.rb:35:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/middleware/flash.rb:254:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/middleware/cookies.rb:560:in `call'
vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/query_cache.rb:36:in `call'
vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:82:in `run_callbacks'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
vendor/bundle/ruby/2.0.0/gems/railties-4.1.6/lib/rails/rack/logger.rb:38:in `call_app'
vendor/bundle/ruby/2.0.0/gems/railties-4.1.6/lib/rails/rack/logger.rb:20:in `block in call'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/tagged_logging.rb:68:in `block in tagged'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/tagged_logging.rb:26:in `tagged'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/tagged_logging.rb:68:in `tagged'
vendor/bundle/ruby/2.0.0/gems/railties-4.1.6/lib/rails/rack/logger.rb:20:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/middleware/request_id.rb:21:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/middleware/static.rb:64:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/middleware/ssl.rb:24:in `call'
vendor/bundle/ruby/2.0.0/gems/railties-4.1.6/lib/rails/engine.rb:514:in `call'
vendor/bundle/ruby/2.0.0/gems/railties-4.1.6/lib/rails/application.rb:144:in `call'
vendor/bundle/ruby/2.0.0/gems/puma-2.9.1/lib/puma/configuration.rb:71:in `call'
vendor/bundle/ruby/2.0.0/gems/puma-2.9.1/lib/puma/server.rb:490:in `handle_request'
vendor/bundle/ruby/2.0.0/gems/puma-2.9.1/lib/puma/server.rb:361:in `process_client'
vendor/bundle/ruby/2.0.0/gems/puma-2.9.1/lib/puma/server.rb:254:in `block in run'
vendor/bundle/ruby/2.0.0/gems/puma-2.9.1/lib/puma/thread_pool.rb:92:in `call'
vendor/bundle/ruby/2.0.0/gems/puma-2.9.1/lib/puma/thread_pool.rb:92:in `block in spawn_thread'

Did you set your smtp settings in config/environments/production.rb?

Related

Uncaught exception: Unable to autoload constant WikiContentVersion, expected

I gets a weird error. The redmine application can run without problem after i install it.
When I rename class WikiContentVersion such as WikiContentVersion1, it will failed just as we expect. However, when I recover the name to WikiContentVersion, it raises an error:
Uncaught exception: Unable to autoload constant WikiContentVersion, expected ........to define it.
Could anyone give me some advices?
Redmine 4.0.3,
ruby 2.5.5p157 (2019-03-15 revision 67260) [i386-mingw32].
Rails 5.2.3
mysql-5.5.62-winx64
windows10
ast Debugger (ruby-debug-ide 0.7.0.beta6, debase 0.2.3.beta2, file filtering is supported) listens on 0.0.0.0:58519
=> Booting WEBrick
=> Rails 5.2.3 application starting in production on http://127.0.0.1:3000
=> Run `rails server -h` for more startup options
Exiting
Uncaught exception: Unable to autoload constant WikiContentVersion, expected F:/webpage/redmine-4.0.3/app/models/wiki_content_version.rb to define it
F:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:511:in `load_missing_constant'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:195:in `const_missing'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:542:in `load_missing_constant'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:195:in `const_missing'
F:/webpage/redmine-4.0.3/app/models/wiki_content.rb:102:in `<class:WikiContent>'
F:/webpage/redmine-4.0.3/app/models/wiki_content.rb:20:in `<top (required)>'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:378:in `block in require_or_load'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:37:in `block in load_interlock'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:13:in `loading'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:37:in `load_interlock'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:356:in `require_or_load'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:334:in `depend_on'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:246:in `require_dependency'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:478:in `block (2 levels) in eager_load!'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:477:in `each'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:477:in `block in eager_load!'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:475:in `each'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:475:in `eager_load!'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:356:in `eager_load!'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/application/finisher.rb:69:in `each'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `instance_exec'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `run'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:61:in `block in run_initializers'
F:/Ruby25/lib/ruby/2.5.0/tsort.rb:228:in `block in tsort_each'
F:/Ruby25/lib/ruby/2.5.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
F:/Ruby25/lib/ruby/2.5.0/tsort.rb:431:in `each_strongly_connected_component_from'
F:/Ruby25/lib/ruby/2.5.0/tsort.rb:349:in `block in each_strongly_connected_component'
F:/Ruby25/lib/ruby/2.5.0/tsort.rb:347:in `each'
F:/Ruby25/lib/ruby/2.5.0/tsort.rb:347:in `call'
F:/Ruby25/lib/ruby/2.5.0/tsort.rb:347:in `each_strongly_connected_component'
F:/Ruby25/lib/ruby/2.5.0/tsort.rb:226:in `tsort_each'
F:/Ruby25/lib/ruby/2.5.0/tsort.rb:205:in `tsort_each'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:60:in `run_initializers'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/application.rb:361:in `initialize!'
F:/webpage/redmine-4.0.3/config/environment.rb:14:in `<top (required)>'
config.ru:3:in `require'
config.ru:3:in `block in <main>'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/rack-2.0.7/lib/rack/builder.rb:55:in `instance_eval'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/rack-2.0.7/lib/rack/builder.rb:55:in `initialize'
config.ru:in `new'
config.ru:in `<main>'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/rack-2.0.7/lib/rack/builder.rb:49:in `eval'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/rack-2.0.7/lib/rack/builder.rb:49:in `new_from_string'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/rack-2.0.7/lib/rack/builder.rb:40:in `parse_file'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/rack-2.0.7/lib/rack/server.rb:319:in `build_app_and_options_from_config'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/rack-2.0.7/lib/rack/server.rb:219:in `app'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:27:in `app'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/rack-2.0.7/lib/rack/server.rb:354:in `wrapped_app'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/rack-2.0.7/lib/rack/server.rb:283:in `start'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:53:in `start'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:147:in `block in perform'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in `tap'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in `perform'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/command/base.rb:65:in `perform'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/command.rb:46:in `invoke'
F:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>'
F:/webpage/redmine-4.0.3/bin/rails:4:in `require'
F:/webpage/redmine-4.0.3/bin/rails:4:in `<top (required)>'

Password authentication failed when setting up gitlab

I've been following the installation guide for GitLab:
https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md
And it has been working great unitl I got to step "Initialize Database and Activate Advanced Features". When i run:
sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
I get the following errors:
FATAL: password authentication failed for user "git"
FATAL: password authentication failed for user "git"
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in `retrieve_connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_handling.rb:87:in `connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/postgresql_database_tasks.rb:6:in `connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/postgresql_database_tasks.rb:28:in `drop'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:114:in `drop'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:128:in `block in drop_current'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:278:in `block in each_current_configuration'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:277:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:277:in `each_current_configuration'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:127:in `drop_current'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/railties/databases.rake:28:in `block (2 levels) in <top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `block in execute'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `execute'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:195:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:188:in `invoke_with_call_chain'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:181:in `invoke'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/railties/databases.rake:131:in `block (2 levels) in <top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `block in execute'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `execute'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:195:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:188:in `invoke_with_call_chain'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:181:in `invoke'
/home/git/gitlab/lib/tasks/gitlab/setup.rake:17:in `setup_db'
/home/git/gitlab/lib/tasks/gitlab/setup.rake:4:in `block (2 levels) in <top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `block in execute'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `execute'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:195:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:188:in `invoke_with_call_chain'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:181:in `invoke'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:160:in `invoke_task'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:116:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:116:in `block in top_level'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:125:in `run_with_threads'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:110:in `top_level'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:83:in `block in run'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:80:in `run'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/bin/rake:22:in `load'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/bin/rake:22:in `<top (required)>'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:75:in `load'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:75:in `kernel_load'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/cli.rb:424:in `exec'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/cli.rb:27:in `dispatch'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/cli.rb:18:in `start'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/exe/bundle:30:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/friendly_errors.rb:122:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/exe/bundle:22:in `<top (required)>'
/usr/local/bin/bundle:22:in `load'
/usr/local/bin/bundle:22:in `<main>'
Couldn't drop gitlabhq_production
FATAL: password authentication failed for user "git"
FATAL: password authentication failed for user "git"
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in `retrieve_connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_handling.rb:87:in `connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/postgresql_database_tasks.rb:6:in `connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/postgresql_database_tasks.rb:15:in `create'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:93:in `create'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:107:in `block in create_current'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:278:in `block in each_current_configuration'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:277:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:277:in `each_current_configuration'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:106:in `create_current'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/railties/databases.rake:17:in `block (2 levels) in <top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `block in execute'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `execute'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:195:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:188:in `invoke_with_call_chain'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:217:in `block in invoke_prerequisites'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:215:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:215:in `invoke_prerequisites'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:194:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:188:in `invoke_with_call_chain'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:217:in `block in invoke_prerequisites'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:215:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:215:in `invoke_prerequisites'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:194:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:188:in `invoke_with_call_chain'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:181:in `invoke'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/railties/databases.rake:132:in `block (2 levels) in <top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `block in execute'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `execute'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:195:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:188:in `invoke_with_call_chain'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:181:in `invoke'
/home/git/gitlab/lib/tasks/gitlab/setup.rake:17:in `setup_db'
/home/git/gitlab/lib/tasks/gitlab/setup.rake:4:in `block (2 levels) in <top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `block in execute'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:251:in `execute'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:195:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:188:in `invoke_with_call_chain'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/task.rb:181:in `invoke'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:160:in `invoke_task'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:116:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:116:in `block in top_level'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:125:in `run_with_threads'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:110:in `top_level'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:83:in `block in run'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:80:in `run'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/bin/rake:22:in `load'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/bin/rake:22:in `<top (required)>'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:75:in `load'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:75:in `kernel_load'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/cli.rb:424:in `exec'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/cli.rb:27:in `dispatch'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/cli.rb:18:in `start'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/exe/bundle:30:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/friendly_errors.rb:122:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/exe/bundle:22:in `<top (required)>'
/usr/local/bin/bundle:22:in `load'
/usr/local/bin/bundle:22:in `<main>'
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"gitlabhq_production", "pool"=>10, "username"=>"git", "password"=>"secure password", "host"=>"localhost"}
-- enable_extension("plpgsql")
rake aborted!
PG::ConnectionBad: FATAL: password authentication failed for user "git"
FATAL: password authentication failed for user "git"
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in `retrieve_connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_handling.rb:87:in `connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/migration.rb:648:in `connection'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/migration.rb:664:in `block in method_missing'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/migration.rb:634:in `block in say_with_time'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/migration.rb:634:in `say_with_time'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/migration.rb:654:in `method_missing'
/home/git/gitlab/db/schema.rb:17:in `block in <top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/schema.rb:41:in `instance_eval'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/schema.rb:41:in `define'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/schema.rb:61:in `define'
/home/git/gitlab/db/schema.rb:14:in `<top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:268:in `load'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:268:in `block in load'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:268:in `load'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:221:in `load_schema_for'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:238:in `block in load_schema_current'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:278:in `block in each_current_configuration'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:277:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:277:in `each_current_configuration'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:237:in `load_schema_current'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/railties/databases.rake:237:in `block (3 levels) in <top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/railties/databases.rake:241:in `block (3 levels) in <top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.10/lib/active_record/railties/databases.rake:132:in `block (2 levels) in <top (required)>'
/home/git/gitlab/lib/tasks/gitlab/setup.rake:17:in `setup_db'
/home/git/gitlab/lib/tasks/gitlab/setup.rake:4:in `block (2 levels) in <top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:22:in `load'
/usr/local/bin/bundle:22:in `<main>'
Tasks: TOP => db:schema:load
(See full trace by running task with --trace)
Essentially, it fails on the password authentication. However, I can run:
sudo -u git -H psql -d gitlabhq_production
Without any problems. I can even specify the -W flag to force password notification. I can enter any password and it will still let me in. My gitlab/config/database.yml contains:
#
# PRODUCTION
#
production:
adapter: postgresql
encoding: unicode
database: gitlabhq_production
pool: 10
username: git
password: "secure password"
host: localhost
#
# Development specific
#
development:
adapter: postgresql
encoding: unicode
database: gitlabhq_development
pool: 5
username: postgres
password: "secure password"
host: localhost
#
# Staging specific
#
staging:
adapter: postgresql
encoding: unicode
database: gitlabhq_staging
pool: 10
username: git
password: "secure password"
host: localhost
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test: &test
adapter: postgresql
encoding: unicode
database: gitlabhq_test
pool: 5
username: postgres
password:
host: localhost
prepared_statements: false
I solved this by setting the password for git using:
sudo -u postgres psql
ALTER USER git WITH PASSWORD '<some password you want>';
I then changed the password in the database.yml to the same password:
sudo -u git -H nano /home/git/gitlab/config/database.yml
EDIT: typo

no implicit conversion of Hash into String (TypeError)

Working on the RoR 5.0.0.beta3 branch. Since yesterday the server wont start anymore.
gems I am using:
gem 'devise', "4.0.0.rc2"
gem 'rails', github: "rails/rails", branch: "v5.0.0.beta3"
gem 'mongoid', github: 'mediatainment/mongoid', branch: 'MONGOID-4218-rails-5'
gem 'simple_token_authentication', github: "mediatainment/simple_token_authentication", branch: :remove_deprication_for_rails51
Here is the stacktrace:
Exiting
/Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:428:in `join': no implicit conversion of Hash into String (TypeError)
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:428:in `block in search_for_file'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:427:in `each'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:427:in `search_for_file'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:502:in `load_missing_constant'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:203:in `const_missing'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/inflector/methods.rb:259:in `const_get'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/inflector/methods.rb:259:in `block in constantize'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/inflector/methods.rb:257:in `each'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/inflector/methods.rb:257:in `inject'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/inflector/methods.rb:257:in `constantize'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/inflector/methods.rb:302:in `safe_constantize'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/core_ext/string/inflections.rb:77:in `safe_constantize'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actioncable/lib/action_cable/engine.rb:34:in `block (2 levels) in <class:Railtie>'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/lazy_load_hooks.rb:44:in `each'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actioncable/lib/action_cable/server/base.rb:81:in `<module:Server>'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actioncable/lib/action_cable/server/base.rb:4:in `<module:ActionCable>'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actioncable/lib/action_cable/server/base.rb:3:in `<top (required)>'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actioncable/lib/action_cable.rb:43:in `server'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actioncable/lib/action_cable/engine.rb:49:in `block (3 levels) in <class:Railtie>'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actionpack/lib/action_dispatch/routing/route_set.rb:389:in `instance_exec'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actionpack/lib/action_dispatch/routing/route_set.rb:389:in `eval_block'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actionpack/lib/action_dispatch/routing/route_set.rb:405:in `block in clear!'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actionpack/lib/action_dispatch/routing/route_set.rb:405:in `each'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actionpack/lib/action_dispatch/routing/route_set.rb:405:in `clear!'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/application/routes_reloader.rb:35:in `block in clear!'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/application/routes_reloader.rb:33:in `each'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/application/routes_reloader.rb:33:in `clear!'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/application/routes_reloader.rb:15:in `reload!'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/file_update_checker.rb:75:in `call'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/file_update_checker.rb:75:in `execute'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/application/routes_reloader.rb:27:in `updater'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/application/finisher.rb:103:in `block in <module:Finisher>'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/initializable.rb:30:in `run'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/application.rb:353:in `initialize!'
from /Users/jan/RubymineProjects/global-gigs-api/config/environment.rb:5:in `<top (required)>'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:293:in `require'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:293:in `block in require'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:259:in `load_dependency'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:293:in `require'
from /Users/jan/RubymineProjects/global-gigs-api/config.ru:3:in `block in <main>'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:55:in `instance_eval'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:55:in `initialize'
from /Users/jan/RubymineProjects/global-gigs-api/config.ru:in `new'
from /Users/jan/RubymineProjects/global-gigs-api/config.ru:in `<main>'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:49:in `eval'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:49:in `new_from_string'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:40:in `parse_file'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-2.0.0.alpha/lib/rack/server.rb:318:in `build_app_and_options_from_config'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-2.0.0.alpha/lib/rack/server.rb:218:in `app'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/commands/server.rb:59:in `app'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-2.0.0.alpha/lib/rack/server.rb:353:in `wrapped_app'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/commands/server.rb:123:in `log_to_stdout'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/commands/server.rb:77:in `start'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/commands/commands_tasks.rb:90:in `block in server'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/commands/commands_tasks.rb:85:in `server'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/commands.rb:18:in `<top (required)>'
from /Users/jan/RubymineProjects/global-gigs-api/bin/rails:9:in `require'
from /Users/jan/RubymineProjects/global-gigs-api/bin/rails:9:in `<top (required)>'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in `load'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in `call'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.4/lib/spring/client/command.rb:7:in `call'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.4/lib/spring/client.rb:28:in `run'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.4/bin/spring:49:in `<top (required)>'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.4/lib/spring/binstub.rb:11:in `load'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.4/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/jan/RubymineProjects/global-gigs-api/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
MacBook-Pro:global-gigs-api jan$
Strange: It seems to be the action_mailer.default was causing the issue. Changed it to default_options.
config.action_mailer.default_options = {
:charset => "utf-8",
from: ENV['MAIL_SENDER_EMAIL']}

How to configure action mailer on rails 4.2 with preview_enabled=true

Since rails 4.2 is now released, I would like to add mailer previews to my project in staging. Following this I though it would simple be putting this code:
config.action_mailer.preview_enabled = true
config.action_mailer.preview_path = "#{Rails.root}/lib/mailer_previews"
to my staging.rb file, but it gives me method_missing error.
What am I doind wrong? Can someone help me?
Stack trace:
method_missing': undefined method `preview_enabled=' for ActionMailer::Base:Class (NoMethodError)
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/actionmailer-4.2.0.rc1/lib/action_mailer/railtie.rb:41:in `block (3 levels) in <class:Railtie>'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/actionmailer-4.2.0.rc1/lib/action_mailer/railtie.rb:41:in `each'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/actionmailer-4.2.0.rc1/lib/action_mailer/railtie.rb:41:in `block (2 levels) in <class:Railtie>'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0.rc1/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0.rc1/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0.rc1/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0.rc1/lib/active_support/lazy_load_hooks.rb:44:in `each'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0.rc1/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/actionmailer-4.2.0.rc1/lib/action_mailer/base.rb:945:in `<class:Base>'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/actionmailer-4.2.0.rc1/lib/action_mailer/base.rb:417:in `<module:ActionMailer>'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/actionmailer-4.2.0.rc1/lib/action_mailer/base.rb:9:in `<top (required)>'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/actionmailer-4.2.0.rc1/lib/action_mailer/railtie.rb:59:in `block in <class:Railtie>'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0.rc1/lib/active_support/lazy_load_hooks.rb:36:in `call'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0.rc1/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0.rc1/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0.rc1/lib/active_support/lazy_load_hooks.rb:44:in `each'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0.rc1/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0.rc1/lib/rails/application/finisher.rb:62:in `block in <module:Finisher>'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0.rc1/lib/rails/initializable.rb:30:in `instance_exec'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0.rc1/lib/rails/initializable.rb:30:in `run'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0.rc1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/vagrant/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /home/vagrant/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /home/vagrant/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /home/vagrant/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /home/vagrant/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /home/vagrant/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /home/vagrant/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /home/vagrant/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /home/vagrant/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0.rc1/lib/rails/initializable.rb:54:in `run_initializers'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0.rc1/lib/rails/application.rb:352:in `initialize!'
from /home/vagrant/workspace/bankfacil/communicator/config/environment.rb:5:in `<top (required)>'
from /home/vagrant/workspace/bankfacil/communicator/config.ru:3:in `require'
from /home/vagrant/workspace/bankfacil/communicator/config.ru:3:in `block in <main>'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/rack-1.6.0.beta2/lib/rack/builder.rb:55:in `instance_eval'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/rack-1.6.0.beta2/lib/rack/builder.rb:55:in `initialize'
from /home/vagrant/workspace/bankfacil/communicator/config.ru:in `new'
from /home/vagrant/workspace/bankfacil/communicator/config.ru:in `<main>'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/rack-1.6.0.beta2/lib/rack/builder.rb:49:in `eval'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/rack-1.6.0.beta2/lib/rack/builder.rb:49:in `new_from_string'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/rack-1.6.0.beta2/lib/rack/builder.rb:40:in `parse_file'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/rack-1.6.0.beta2/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/rack-1.6.0.beta2/lib/rack/server.rb:208:in `app'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0.rc1/lib/rails/commands/server.rb:61:in `app'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/rack-1.6.0.beta2/lib/rack/server.rb:336:in `wrapped_app'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0.rc1/lib/rails/commands/server.rb:139:in `log_to_stdout'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0.rc1/lib/rails/commands/server.rb:78:in `start'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0.rc1/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0.rc1/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0.rc1/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0.rc1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/vagrant/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0.rc1/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
It works, in staging.rb,just add show_previews instead of preview_enabled, like this :
config.consider_all_requests_local = true
# mailer previews
config.action_mailer.show_previews = true
config.action_mailer.preview_path = "#{Rails.root}/lib/mailer_previews"

rake assets:precompile doesn't work with PostgreSql

I'm trying to deploy a Rails 3.2.3 App that uses Postgres. I got the deploy itself working via Capistrano, also the db migrations worked. But now I'm stuck precompiling the assets:
deploy:MyAPP/current$ bundle exec rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/home/deploy/.rvm/rubies/ruby-1.9.3-p194/bin/ruby /home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
** Invoke assets:precompile:nondigest (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
rake aborted!
FATAL: role "deploy" does not exist
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:1194:in `initialize'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:1194:in `new'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:1194:in `connect'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:329:in `initialize'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `new'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `postgresql_connection'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:303:in `new_connection'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:313:in `checkout_new_connection'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:237:in `block (2 levels) in checkout'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:232:in `loop'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:232:in `block in checkout'
/home/deploy/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `checkout'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `connection'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in `retrieve_connection'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/model_schema.rb:308:in `clear_cache!'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/railtie.rb:91:in `block (2 levels) in <class:Railtie>'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:418:in `_run__1909267555841955845__prepare__3200542818861587462__callbacks'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in `__run_callback'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:81:in `run_callbacks'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/deploy/www/MyApp/releases/20120503154931/config/environment.rb:5:in `<top (required)>'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/application.rb:103:in `require_environment!'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/application.rb:292:in `block (2 levels) in initialize_tasks'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/deploy/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/sprockets/assets.rake:93:in `block (2 levels) in <top (required)>'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/deploy/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/home/deploy/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/bin/rake:23:in `load'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/bin/rake:23:in `<main>'
Tasks: TOP => environment
rake aborted!
Command failed with status (1): [/home/deploy/.rvm/rubies/ruby-1.9.3-p194/b...]
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `call'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `sh'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `sh'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils.rb:80:in `ruby'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `ruby'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/deploy/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/bin/rake:23:in `load'
/home/deploy/www/MyApp/shared/bundle/ruby/1.9.1/bin/rake:23:in `<main>'
Tasks: TOP => assets:precompile
For some reason it tries to login to Postgres as the systemuser "deploy", but I have absolutely no idea why – I have never experienced that issue with MySql...
Does anybody have an idea?
Cheers, CS
Rake initializes the whole rails stack and the postgres adapter seems to test the connection on startup. Since there are no credentials for that case, rake fails.
To prevent rake from doing so, I had to put that in my config/application.rb:
config.assets.initialize_on_precompile = false
That works for me!
Found in this answer.
If you don't supply any other username by default PostgreSQL will use the operating-system username (when connections are local the the one machine). That's presumably why it's using "deploy".
Where/how you need to set the database name so it gets picked up I can't say I'm afraid.