データベースからデータを取得し、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 で正常に動作します。デプロイしようとすると