帮助我!输入“mina deploy”获取此美景:
my“/home/deploy/inscope/shared/config/database.yml”看起来:

production:
  adapter: postgresql
  encoding: unicode
  database: ***
  username: ***
  password: ***
  host: localhost

rake aborted!
   Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add `gem 'pg'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/connection_specification.rb:190:in `rescue in spec'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/connection_specification.rb:187:in `spec'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.0/lib/active_record/connection_handling.rb:50:in `establish_connection'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.0/lib/active_record/railtie.rb:129:in `block (2 levels) in <class:Railtie>'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:27:in `each'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.0/lib/active_record/railtie.rb:118:in `block in <class:Railtie>'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/railties-4.1.0/lib/rails/initializable.rb:30:in `instance_exec'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/railties-4.1.0/lib/rails/initializable.rb:30:in `run'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/railties-4.1.0/lib/rails/initializable.rb:55:in `block in run_initializers'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/railties-4.1.0/lib/rails/initializable.rb:54:in `run_initializers'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/railties-4.1.0/lib/rails/application.rb:288:in `initialize!'
   /home/deploy/inscope/tmp/build-142737137923106/config/environment.rb:5:in `<top (required)>'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `block in require'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/railties-4.1.0/lib/rails/application.rb:264:in `require_environment!'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/railties-4.1.0/lib/rails/application.rb:367:in `block in run_tasks_blocks'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/task.rb:64:in `block (2 levels) in define'
   Gem::LoadError: pg is not part of the bundle. Add it to Gemfile.
   /home/deploy/.rvm/gems/ruby-2.2.0/gems/bundler-1.9.1/lib/bundler/rubygems_integration.rb:261:in `block in replace_gem'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:13:in `<top (required)>'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `block in require'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/connection_specification.rb:188:in `spec'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.0/lib/active_record/connection_handling.rb:50:in `establish_connection'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.0/lib/active_record/railtie.rb:129:in `block (2 levels) in <class:Railtie>'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:27:in `each'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.0/lib/active_record/railtie.rb:118:in `block in <class:Railtie>'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/railties-4.1.0/lib/rails/initializable.rb:30:in `instance_exec'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/railties-4.1.0/lib/rails/initializable.rb:30:in `run'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/railties-4.1.0/lib/rails/initializable.rb:55:in `block in run_initializers'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/railties-4.1.0/lib/rails/initializable.rb:54:in `run_initializers'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/railties-4.1.0/lib/rails/application.rb:288:in `initialize!'
   /home/deploy/inscope/tmp/build-142737137923106/config/environment.rb:5:in `<top (required)>'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `block in require'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/railties-4.1.0/lib/rails/application.rb:264:in `require_environment!'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/railties-4.1.0/lib/rails/application.rb:367:in `block in run_tasks_blocks'
   /home/deploy/inscope/tmp/build-142737137923106/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/task.rb:64:in `block (2 levels) in define'
   Tasks: TOP => environment
   (See full trace by running task with --trace)

啊!错误:部署失败。
--->正在清理生成
解链电流
好啊
啊!命令失败。
失败,状态19

最佳答案

你得加上

gem 'pg'

在您的GEMFILE中,您可以在第一行错误中看到它:
    Gem::LoadError: Specified 'postgresql' for database adapter,
but the gem is not loaded.
 Add `gem 'pg'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

关于ruby-on-rails - Gem::LoadError:为数据库适配器指定了“postgresql”,但未加载gem,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/29278186/

10-14 15:49