rails console unable to connect to database in staging environment -
using capistrano i'm deploying rails 4 app under environment name "staging". when ssh onto server , run rails console, activerecord queries come no such table. check rails.env , sure enough reads development instead of staging. running rails console staging, set rails.env "staging", still activerecord queries no such table. app running fine (under apache , passenger), reason rails console unable connect db.
i've reverted when knew working , still seeing error, tells me configuration change must've made on server opposed change rails app code or capistrano deploy config.
ok, tracked down answer myself. rails_env being set staging in /etc/environment -- while ago file removed during debugging, , not restored.
what still surprise me
rails console staging does not have same effect as
export rails_env=staging rails console anyhow, sorted.
Comments
Post a Comment