The demo Rails app that I'm using is from Michael Hartl's Rails tutorial at http://ruby.railstutorial.org/chapters/a-demo-app .
I've successfully deployed this demo SQLite-based Rails app to WebFaction by following the instructions at http://docs.webfaction.com/software/rails.html on deploying Rails with Capistrano. I was able to get the app to work on WebFaction, but I had to change the production setup to SQLite (using the procedure described in the troubleshooting section) in order to do so. As you know, SQLite is easy to work with and is thus suitable for a learning exercise. However, Postgres is the way to go for a serious app that can handle lots of traffic, and SQLite is the database version of training wheels.
I've successfully managed to create a demo Rails app in Postgres locally.
What I'm still trying to do is deploy this Postgres demo Rails app on WebFaction. The procedure at http://docs.webfaction.com/software/rails.html on using Capistrano to deploy Rails isn't enough. I should be seeing an option to add users at http://testrails2.doppler.webfactional.com/users , but I'm instead getting the "We're sorry, but something went wrong." page. Based on the error messages (which I've printed out at the end of this message), it sounds like I need to create a Postgres database here on WebFaction. I see that the Rails page on WebFaction includes instructions on how to set up a database, but how do I make it accessible to this app?
When I enter "rake db:create:all", the first line of the LONG error message I see on the screen output is:
FATAL: no pg_hba.conf entry for host "[local]", user "jhsu", database "postgres", SSL off
The contents in the production.log page are:
Connecting to database specified by database.yml
Started GET "/users" for 74.5.74.201 at 2013-03-28 05:29:20 +0000
PG::Error (FATAL: no pg_hba.conf entry for host "[local]", user "jhsu", database "demo_production", SSL off
):
activerecord (3.2.12) lib/active_record/connection_adapters/postgresql_adapter.rb:1208:in initialize'
activerecord (3.2.12) lib/active_record/connection_adapters/postgresql_adapter.rb:1208:in
new'
activerecord (3.2.12) lib/active_record/connection_adapters/postgresql_adapter.rb:1208:in connect'
activerecord (3.2.12) lib/active_record/connection_adapters/postgresql_adapter.rb:326:in
initialize'
activerecord (3.2.12) lib/active_record/connection_adapters/postgresql_adapter.rb:28:in new'
activerecord (3.2.12) lib/active_record/connection_adapters/postgresql_adapter.rb:28:in
postgresql_connection'
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in new_connection'
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in
checkout_new_connection'
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in block (2 levels) in checko$
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in
loop'
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in block in checkout'
/usr/local/lib/ruby19/ruby/1.9.1/monitor.rb:211:in
mon_synchronize'
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in checkout'
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in
block in connection'
/usr/local/lib/ruby19/ruby/1.9.1/monitor.rb:211:in mon_synchronize'
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in
connection'
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in retrieve_connection'
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in
retrieve_connecti$
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in connection'
activerecord (3.2.12) lib/active_record/query_cache.rb:67:in
rescue in call'
activerecord (3.2.12) lib/active_record/query_cache.rb:61:in call'
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in
call'
actionpack (3.2.12) lib/action_dispatch/middleware/callbacks.rb:28:in block in call'
activesupport (3.2.12) lib/active_support/callbacks.rb:405:in
_run1285076083195215389call1393867088726063903callb$
activesupport (3.2.12) lib/active_support/callbacks.rb:405:in __run_callback'
activesupport (3.2.12) lib/active_support/callbacks.rb:385:in
_run_call_callbacks'
activesupport (3.2.12) lib/active_support/callbacks.rb:81:in run_callbacks'
actionpack (3.2.12) lib/action_dispatch/middleware/callbacks.rb:27:in
call'
actionpack (3.2.12) lib/action_dispatch/middleware/remote_ip.rb:31:in call'
actionpack (3.2.12) lib/action_dispatch/middleware/debug_exceptions.rb:16:in
call'
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in checkout'
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in
block in connection'
/usr/local/lib/ruby19/ruby/1.9.1/monitor.rb:211:in mon_synchronize'
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in
connection'
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in retrieve_connection'
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in
retrieve_connecti$
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in connection'
activerecord (3.2.12) lib/active_record/query_cache.rb:67:in
rescue in call'
activerecord (3.2.12) lib/active_record/query_cache.rb:61:in call'
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in
call'
actionpack (3.2.12) lib/action_dispatch/middleware/callbacks.rb:28:in block in call'
activesupport (3.2.12) lib/active_support/callbacks.rb:405:in
_run1285076083195215389call1393867088726063903callb$
activesupport (3.2.12) lib/active_support/callbacks.rb:405:in __run_callback'
activesupport (3.2.12) lib/active_support/callbacks.rb:385:in
_run_call_callbacks'
activesupport (3.2.12) lib/active_support/callbacks.rb:81:in run_callbacks'
actionpack (3.2.12) lib/action_dispatch/middleware/callbacks.rb:27:in
call'
actionpack (3.2.12) lib/action_dispatch/middleware/remote_ip.rb:31:in call'
actionpack (3.2.12) lib/action_dispatch/middleware/debug_exceptions.rb:16:in
call'
actionpack (3.2.12) lib/action_dispatch/middleware/show_exceptions.rb:56:in call'
railties (3.2.12) lib/rails/rack/logger.rb:32:in
call_app'
railties (3.2.12) lib/rails/rack/logger.rb:16:in block in call'
activesupport (3.2.12) lib/active_support/tagged_logging.rb:22:in
tagged'
railties (3.2.12) lib/rails/rack/logger.rb:16:in call'
actionpack (3.2.12) 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.12) lib/active_support/cache/strategy/local_cache.rb:72:in call'
rack (1.4.5) lib/rack/lock.rb:15:in
call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in forward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in
fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in lookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in
call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in call'
railties (3.2.12) lib/rails/engine.rb:479:in
call'
railties (3.2.12) lib/rails/application.rb:223:in call'
actionpack (3.2.12) lib/action_dispatch/middleware/debug_exceptions.rb:16:in
call'
actionpack (3.2.12) lib/action_dispatch/middleware/show_exceptions.rb:56:in call'
railties (3.2.12) lib/rails/rack/logger.rb:32:in
call_app'
railties (3.2.12) lib/rails/rack/logger.rb:16:in block in call'
activesupport (3.2.12) lib/active_support/tagged_logging.rb:22:in
tagged'
railties (3.2.12) lib/rails/rack/logger.rb:16:in call'
actionpack (3.2.12) 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.12) lib/active_support/cache/strategy/local_cache.rb:72:in call'
rack (1.4.5) lib/rack/lock.rb:15:in
call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in forward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in
fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in lookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in
call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in call'
railties (3.2.12) lib/rails/engine.rb:479:in
call'
railties (3.2.12) lib/rails/application.rb:223:in call'
railties (3.2.12) lib/rails/railtie/configurable.rb:30:in
method_missing'
passenger (3.0.11) lib/phusion_passenger/rack/request_handler.rb:96:in process_request'
passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:513:in
accept_and_process_next_request'
passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:274:in main_loop'
passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:206:in
start_request_handler'
passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:79:in block in spawn_application'
passenger (3.0.11) lib/phusion_passenger/utils.rb:479:in
safe_fork'
passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:64:in spawn_application'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:264:in
spawn_rack_application'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:137:in spawn_application'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:275:in
handle_spawn_application'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in server_main_loop'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in
start_synchronously'
passenger (3.0.11) helper-scripts/passenger-spawn-server:99:in `<main>'
asked
26 Mar '13, 23:45
dopplervalue...
45●1●5●8
accept rate:
100%