我是一个 Ruby Noob 编写脚本以从数据库中提取数据并使用 active_record 加载表:
这些是我在脚本中需要的宝石。要求 'pg' gem 也无济于事(尝试过)..
require 'active_record'
require 'rubygems'
require 'vertica'
require 'postgres'
require 'pony'
该脚本在我的 Mac 上运行良好。当我尝试在应用服务器上部署它时,它会崩溃并出现以下错误...
我什至不知道这个错误是什么意思:
libpq.so.5: cannot open shared object file: No such file or directory - /gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/pg-0.14.1/lib/pg_ext.so
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `block in require'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in `new_constants_in'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/pg-0.14.1/lib/pg.rb:4:in `<top (required)>'
<internal:lib/rubygems/custom_require>:33:in `require'
<internal:lib/rubygems/custom_require>:33:in `rescue in require'
<internal:lib/rubygems/custom_require>:29:in `require'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `block in require'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in `new_constants_in'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.5/lib/active_record/connection_adapters/postgresql_adapter.rb:9:in `postgresql_connection'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `new_connection'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:237:in `checkout_new_connection'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:191:in `block (2 levels) in checkout'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:187:in `loop'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:187:in `block in checkout'
/gds/apps/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:186:in `checkout'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:94:in `connection'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:317:in `retrieve_connection'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:97:in `retrieve_connection'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in `connection'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/arel-2.0.2/lib/arel/table.rb:127:in `table_cache'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/arel-2.0.2/lib/arel/table.rb:122:in `tables'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/arel-2.0.2/lib/arel/table.rb:118:in `table_exists?'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/arel-2.0.2/lib/arel/table.rb:97:in `[]'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.5/lib/active_record/relation/predicate_builder.rb:23:in `block in build_from_hash'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.5/lib/active_record/relation/predicate_builder.rb:9:in `each'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.5/lib/active_record/relation/predicate_builder.rb:9:in `map'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.5/lib/active_record/relation/predicate_builder.rb:9:in `build_from_hash'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.5/lib/active_record/relation/query_methods.rb:227:in `build_where'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.5/lib/active_record/relation/query_methods.rb:77:in `where'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.5/lib/active_record/relation.rb:221:in `destroy_all'
/gds/apps/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activerecord-3.0.5/lib/active_record/base.rb:439:in `destroy_all'
./edx_vert_to_pg.rb:43:in `<main>'
该脚本在我的 Mac 上运行良好。当我尝试部署它时