mercredi 10 juin 2015

Elastic Beanstalk Deploying Issue - Production Database Is Not Configured

I am having issues deploying my Rails API to Elastic Beanstalk. I cannot seem to get rid of the following error: ActiveRecord::AdapterNotSpecified: 'production' database is not configured. Available: ["development", "test"]

Please help me figure this out. I am attaching details below.

/config/database.yml

default: &defaults adapter: postgresql encoding: unicode min_messages: warning pool: 5 timeout: 10000 username: postgres host: localhost development: <<: *defaults database: app_development test: <<: *defaults database: app_test staging: <<: *defaults database: app_staging production: <<: *defaults adapter: postgresql encoding: unicode database: <%= ENV['RDS_DB_NAME'] %> username: <%= ENV['RDS_USERNAME'] %> password: <%= ENV['RDS_PASSWORD'] %> host: <%= ENV['RDS_HOSTNAME'] %> port: <%= ENV['RDS_PORT'] %> pool: 5

/config/environments/production.rb

config.assets.compile = false

config.assets.initialize_on_precompile = false

EB Logs

[Instance: i-13bf48db] Command failed on instance. Return code: 1 Output: (TRUNCATED)http://...ib/rails/application.rb:389:in `block in run_tasks_blocks' /home/rof/cache/bundler/ruby/2.1.0/gems/sprockets-rails-2.3.1/lib/sprockets/rails/task.rb:64:in `block (2 levels) in define' Tasks: TOP => environment (See full trace by running task with --trace). Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

and

+++ RUBY_VERSION=2.1.5 +++ export GEM_ROOT=/opt/rubies/ruby-2.1.5/lib/ruby/gems/2.1.0 +++ GEM_ROOT=/opt/rubies/ruby-2.1.5/lib/ruby/gems/2.1.0 ++ (( 0 != 0 )) + cd /var/app/ondeck + su -s /bin/bash -c 'bundle exec /opt/elasticbeanstalk/support/scripts/check-for-rake-task.rb assets:precompile' webapp + '[' false == true ']' + su -s /bin/bash -c 'bundle exec rake assets:precompile' webapp rake aborted! ActiveRecord::AdapterNotSpecified: 'production' database is not configured. Available: ["development", "test"] /home/rof/cache/bundler/ruby/2.1.0/gems/activerecord-4.1.8/lib/active_record/connection_adapters/connection_specification.rb:257:in `resolve_symbol_connection' /home/rof/cache/bundler/ruby/2.1.0/gems/activerecord-4.1.8/lib/active_record/connection_adapters/connection_specification.rb:224:in `resolve_connection' /home/rof/cache/bundler/ruby/2.1.0/gems/activerecord-4.1.8/lib/active_record/connection_adapters/connection_specification.rb:152:in `resolve' /home/rof/cache/bundler/ruby/2.1.0/gems/activerecord-4.1.8/lib/active_record/connection_adapters/connection_specification.rb:182:in `spec' /home/rof/cache/bundler/ruby/2.1.0/gems/activerecord-4.1.8/lib/active_record/connection_handling.rb:50:in `establish_connection' /home/rof/cache/bundler/ruby/2.1.0/gems/activerecord-4.1.8/lib/active_record/railtie.rb:129:in `block (2 levels) in <class:Railtie>' /home/rof/cache/bundler/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval' /home/rof/cache/bundler/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook' /home/rof/cache/bundler/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load' /home/rof/cache/bundler/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:27:in `each' /home/rof/cache/bundler/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:27:in `on_load' /home/rof/cache/bundler/ruby/2.1.0/gems/activerecord-4.1.8/lib/active_record/railtie.rb:118:in `block in <class:Railtie>' /home/rof/cache/bundler/ruby/2.1.0/gems/railties-4.1.8/lib/rails/initializable.rb:30:in `instance_exec' /home/rof/cache/bundler/ruby/2.1.0/gems/railties-4.1.8/lib/rails/initializable.rb:30:in `run' /home/rof/cache/bundler/ruby/2.1.0/gems/railties-4.1.8/lib/rails/initializable.rb:55:in `block in run_initializers' /home/rof/cache/bundler/ruby/2.1.0/gems/railties-4.1.8/lib/rails/initializable.rb:54:in `run_initializers' /home/rof/cache/bundler/ruby/2.1.0/gems/railties-4.1.8/lib/rails/application.rb:300:in `initialize!' /var/app/ondeck/config/environment.rb:5:in `<top (required)>' /home/rof/cache/bundler/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require' /home/rof/cache/bundler/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `block in require' /home/rof/cache/bundler/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:232:in `load_dependency' /home/rof/cache/bundler/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require' /home/rof/cache/bundler/ruby/2.1.0/gems/railties-4.1.8/lib/rails/application.rb:276:in `require_environment!' /home/rof/cache/bundler/ruby/2.1.0/gems/railties-4.1.8/lib/rails/application.rb:389:in `block in run_tasks_blocks' /home/rof/cache/bundler/ruby/2.1.0/gems/sprockets-rails-2.3.1/lib/sprockets/rails/task.rb:64:in `block (2 levels) in define' Tasks: TOP => environment (See full trace by running task with --trace) (Executor::NonZeroExitStatus)




1 commentaire: