ruby - Deploying to Heroku, Rails app -
i trying deploy rails app heroku. app uploaded not run reason. when type
heroku run rake db:migrate
i error saying
activerecord::connectiontimeouterror: not obtain database connection within 5.000 seconds (waited 5.000 seconds)
i using puma server , post of files might cause problem... please ask might cause error!
config/database.ymi
production: adapter: postgresql host: localhost encoding: unicode database: fastorder_production pool: 5 username: <%= env['fastorder_database_user'] %> password: <%= env['fastorder_database_password'] %> template: template0 url: <%= env["database_url"] %> pool: env['rails_max_threads']
config/puma.rb
workers integer(env['web_concurrency'] || 2) threads_count = integer(env['rails_max_threads'] || 5) threads threads_count, threads_count preload_app! rackup defaultrackup port env['port'] || 3000 environment env['rack_env'] || 'development' on_worker_boot # worker specific setup rails 4.1+ # see: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot activerecord::base.establish_connection end
you should create db first:
heroku run rake db:create
also, check heroku doc db connections: https://devcenter.heroku.com/articles/concurrency-and-database-connections
Comments
Post a Comment