postgresql - Can access production database from Rails console but not Rails App -


when try login devise app using rails console on production database, can no trouble, cannot when using rails app.

i launch rails console rails c -e production, home environment (not sshing int or anything) , proceed execute app.post('/users/sign_in', {"user"=>{"email"=>"email", "password"=>"password"}}), succeeds with:

started post "/users/sign_in" 127.0.0.1 @ 2014-03-10 05:37:31 +0000 started post "/users/sign_in" 127.0.0.1 @ 2014-03-10 05:37:31 +0000 processing devisesessionscontroller#create html processing devisesessionscontroller#create html   parameters: {"user"=>{"email"=>"amar@sittr.co.nz", "password"=>"[filtered]"}}   parameters: {"user"=>{"email"=>"amar@sittr.co.nz", "password"=>"[filtered]"}} redirected http://www.example.com/dashboard redirected http://www.example.com/dashboard completed 302 found in 1830ms (activerecord: 1426.3ms) completed 302 found in 1830ms (activerecord: 1426.3ms)  => 302 

from can use app.get '/dashboard' password protected page, , succeeds with:

started "/dashboard" 127.0.0.1 @ 2014-03-10 05:38:14 +0000 started "/dashboard" 127.0.0.1 @ 2014-03-10 05:38:14 +0000 processing staticpagescontroller#home html processing staticpagescontroller#home html   rendered static_pages/home.html.haml within layouts/application (139.6ms)   rendered static_pages/home.html.haml within layouts/application (139.6ms) completed 200 ok in 6370ms (views: 686.2ms | activerecord: 5087.6ms) completed 200 ok in 6370ms (views: 686.2ms | activerecord: 5087.6ms)  => 200 

this working expected, except when try , go production site, , sign in same credentials, gives me 500 error errno::econnrefuseddevise_sessions#create connection refused - connect(2) "localhost" port 9200. confuses me says trying connect localhost wouldn't make sense. following database.yml file (with sensitive bits taken out):

production:   adapter: postgresql   database: db_name   pool: 5   timeout: 5000   host: rds.database.com   port: 5432   username: username   password: password 

as can see, have set port , host correctly. doing wrong? in advance.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -