与Oracle的连接错误

时间:2014-01-30 13:05:34

标签: ruby-on-rails ruby database oracle

我正在使用Rails 3.2.16 and ruby-1.9.3-p484
我的宝石文件在这里

 source 'https://rubygems.org'


gem 'rails', '3.2.16'


gem 'ruby-oci8'

gem 'sqlite3', :group => [:development, :test]


gem 'json'

# Gems used only for assets and not required
# in production environments by default.
group :assets do

  #gem 'sass-rails', '~> 3.2.3'
  #gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'


# To use debugger
# gem 'ruby-debug'

gem "rake", "0.8.7"


gem "activerecord-oracle_enhanced-adapter",'1.4.1'

gem "rspec-core"
gem "rspec-rails", :group => [:development, :test]

gem "factory_girl_rails", "~> 1.0", :group => [:development, :test]

gem "brakeman", :group => [:development, :test]

gem "cucumber-rails", :group => [:test]

gem 'therubyracer', '~> 0.10.2'

gem "crypto", '~> 0.0.3'
gem "capistrano"
#gem "distribute"

gem 'mail'
gem 'paperclip', '~> 2.7'

gem "simplecov"
gem 'fastercsv'
gem 'unicorn-rails'
gem 'docsplit'
#gem "puma"

#gem 'libv8', '~> 3.11.8.3'

和数据库配置

development:
  adapter: oracle_enhanced
   database: //172.15.12.86:1521/XE
  username: uname
  password: password
  pool: 5
  timeout: 5000

它给了我们

 OCIError (ORA-12543: TNS:destination host unreachable):
  oci8.c:513:in oci8lib_191.so
  ruby-oci8 (2.1.6) lib/oci8/oci8.rb:148:in `initialize'
  activerecord-oracle_enhanced-adapter (1.4.1) lib/active_record/connection_adapters/oracle_enhanced_oci_connection.rb:319:in `new'
  activerecord-oracle_enhanced-adapter (1.4.1) lib/active_record/connection_adapters/oracle_enhanced_oci_connection.rb:319:in `new_connection'
  activerecord-oracle_enhanced-adapter (1.4.1) lib/active_record/connection_adapters/oracle_enhanced_oci_connection.rb:429:in `initialize'
  activerecord-oracle_enhanced-adapter (1.4.1) lib/active_record/connection_adapters/oracle_enhanced_oci_connection.rb:24:in `new'
  activerecord-oracle_enhanced-adapter (1.4.1) lib/active_record/connection_adapters/oracle_enhanced_oci_connection.rb:24:in `initialize'
  activerecord-oracle_enhanced-adapter (1.4.1) lib/active_record/connection_adapters/oracle_enhanced_connection.rb:9:in `new'
  activerecord-oracle_enhanced-adapter (1.4.1) lib/active_record/connection_adapters/oracle_enhanced_connection.rb:9:in `create'
  activerecord-oracle_enhanced-adapter (1.4.1) lib/active_record/connection_adapters/oracle_enhanced_base_ext.rb:13:in `oracle_enhanced_connection'
  activerecord (3.2.16) lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
  activerecord (3.2.16) lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
  activerecord (3.2.16) lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
  activerecord (3.2.16) lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
  activerecord (3.2.16) lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
  /home/manoj/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
  activerecord (3.2.16) lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
  activerecord (3.2.16) lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
  /home/manoj/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
  activerecord (3.2.16) lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
  activerecord (3.2.16) lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
  activerecord (3.2.16) lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
  activerecord (3.2.16) lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
  activerecord (3.2.16) lib/active_record/query_cache.rb:67:in `rescue in call'
  activerecord (3.2.16) lib/active_record/query_cache.rb:61:in `call'
  activerecord (3.2.16) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  activesupport (3.2.16) lib/active_support/callbacks.rb:405:in `_run__471194695__call__203506390__callbacks'
  activesupport (3.2.16) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.16) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.16) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.16) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/reloader.rb:65:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.16) lib/rails/rack/logger.rb:32:in `call_app'
  railties (3.2.16) lib/rails/rack/logger.rb:16:in `block in call'
  activesupport (3.2.16) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.16) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.16) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/static.rb:63:in `call'
  railties (3.2.16) lib/rails/engine.rb:484:in `call'
  railties (3.2.16) lib/rails/application.rb:231:in `call'
  rack (1.4.5) lib/rack/content_length.rb:14:in `call'
  railties (3.2.16) lib/rails/rack/log_tailer.rb:17:in `call'
  unicorn (4.8.1) lib/unicorn/http_server.rb:571:in `process_client'
  unicorn (4.8.1) lib/unicorn/http_server.rb:665:in `worker_loop'
  unicorn (4.8.1) lib/unicorn/http_server.rb:520:in `spawn_missing_workers'
  unicorn (4.8.1) lib/unicorn/http_server.rb:140:in `start'
  unicorn-rails (1.1.0) lib/unicorn/rails.rb:24:in `run'
  rack (1.4.5) lib/rack/server.rb:268:in `start'
  railties (3.2.16) lib/rails/commands/server.rb:70:in `start'
  railties (3.2.16) lib/rails/commands.rb:55:in `block in <top (required)>'
  railties (3.2.16) lib/rails/commands.rb:50:in `tap'
  railties (3.2.16) lib/rails/commands.rb:50:in `<top (required)>'
  script/rails:6:in `require'
  script/rails:6:in `<main>'

请帮帮我

0 个答案:

没有答案