bundle exec rake db:schema:load - codeship 失败

bundle exec rake db:schema:load - fails on codeship

我正在尝试将 Codeship 用于 Rails 应用程序,但是当我推送到 Github 并且 Codeship 创建构建时,我遇到了这个我无法解决的错误:

bundle exec rake db:schema:load
rake aborted!

PG::ConnectionBad: FATAL:  no pg_hba.conf entry for host "xxx", user "xxx", database "xxx", SSL off

以下是失败构建的更多信息:

/home/rof/cache/bundler/ruby/2.2.0/gems/pg-0.20.0/lib/pg.rb:56:in `initialize'
/home/rof/cache/bundler/ruby/2.2.0/gems/pg-0.20.0/lib/pg.rb:56:in `new'
/home/rof/cache/bundler/ruby/2.2.0/gems/pg-0.20.0/lib/pg.rb:56:in `connect'
/home/rof/cache/bundler/ruby/2.2.0/gems/activerecord-5.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `connect'
/home/rof/cache/bundler/ruby/2.2.0/gems/activerecord-5.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:217:in `initialize'
/home/rof/cache/bundler/ruby/2.2.0/gems/activerecord-5.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `new'
/home/rof/cache/bundler/ruby/2.2.0/gems/activerecord-5.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/home/rof/cache/bundler/ruby/2.2.0/gems/activerecord-5.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:729:in `new_connection'
/home/rof/cache/bundler/ruby/2.2.0/gems/activerecord-5.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:773:in `checkout_new_connection'
/home/rof/cache/bundler/ruby/2.2.0/gems/activerecord-5.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:752:in `try_to_checkout_new_connection'
/home/rof/cache/bundler/ruby/2.2.0/gems/activerecord-5.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:713:in `acquire_connection'
/home/rof/cache/bundler/ruby/2.2.0/gems/activerecord-5.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:490:in `checkout'
/home/rof/cache/bundler/ruby/2.2.0/gems/activerecord-5.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:364:in `connection'
/home/rof/cache/bundler/ruby/2.2.0/gems/activerecord-5.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:883:in `retrieve_connection'
/home/rof/cache/bundler/ruby/2.2.0/gems/activerecord-5.0.3/lib/active_record/connection_handling.rb:128:in `retrieve_connection'
/home/rof/cache/bundler/ruby/2.2.0/gems/activerecord-5.0.3/lib/active_record/connection_handling.rb:91:in `connection'
/home/rof/cache/bundler/ruby/2.2.0/gems/activerecord-5.0.3/lib/active_record/migration.rb:1038:in `current_version'
/home/rof/cache/bundler/ruby/2.2.0/gems/activerecord-5.0.3/lib/active_record/migration.rb:1273:in `last_stored_environment'
/home/rof/cache/bundler/ruby/2.2.0/gems/activerecord-5.0.3/lib/active_record/tasks/database_tasks.rb:48:in `check_protected_environments!'
/home/rof/cache/bundler/ruby/2.2.0/gems/activerecord-5.0.3/lib/active_record/railties/databases.rake:11:in `block (2 levels) in <top (required)>'
/home/rof/cache/bundler/ruby/2.2.0/gems/airbrake-6.1.1/lib/airbrake/rake.rb:19:in `execute'
/home/rof/cache/bundler/ruby/2.2.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/home/rof/.rvm/gems/ruby-2.2.3/gems/bundler-1.15.0/lib/bundler/cli/exec.rb:74:in `load'
/home/rof/.rvm/gems/ruby-2.2.3/gems/bundler-1.15.0/lib/bundler/cli/exec.rb:74:in `kernel_load'
/home/rof/.rvm/gems/ruby-2.2.3/gems/bundler-1.15.0/lib/bundler/cli/exec.rb:27:in `run'
/home/rof/.rvm/gems/ruby-2.2.3/gems/bundler-1.15.0/lib/bundler/cli.rb:360:in `exec'
/home/rof/.rvm/gems/ruby-2.2.3/gems/bundler-1.15.0/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/rof/.rvm/gems/ruby-2.2.3/gems/bundler-1.15.0/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/rof/.rvm/gems/ruby-2.2.3/gems/bundler-1.15.0/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
/home/rof/.rvm/gems/ruby-2.2.3/gems/bundler-1.15.0/lib/bundler/cli.rb:20:in `dispatch'
/home/rof/.rvm/gems/ruby-2.2.3/gems/bundler-1.15.0/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
/home/rof/.rvm/gems/ruby-2.2.3/gems/bundler-1.15.0/lib/bundler/cli.rb:10:in `start'
/home/rof/.rvm/gems/ruby-2.2.3/gems/bundler-1.15.0/exe/bundle:35:in `block in <top (required)>'
/home/rof/.rvm/gems/ruby-2.2.3/gems/bundler-1.15.0/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/home/rof/.rvm/gems/ruby-2.2.3/gems/bundler-1.15.0/exe/bundle:27:in `<top (required)>'
/home/rof/.rvm/gems/ruby-2.2.3/bin/bundle:23:in `load'
/home/rof/.rvm/gems/ruby-2.2.3/bin/bundle:23:in `<main>'
/home/rof/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'
/home/rof/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:schema:load => db:check_protected_environments
(See full trace by running task with --trace)

如有任何帮助,我们将不胜感激。谢谢!

我将在这里回答我自己的问题。 Codeship 的支持不是很有帮助,在我按照文档中的所有步骤进行操作后,它仍然无法正常工作。不知道为什么,但是终止项目并使用完全相同的代码以及完全相同的设置和测试步骤创建一个新项目,这解决了问题¯_(ツ)_/¯