Using Cap 3 and capistrano_rails on rails 4 I was getting the same error; in the environment file(s) being deployed, I set
set :stage, :production
set :rails_env, 'production' # even though doc says only need to do this if it's different
Doc here: https://github.com/capistrano/rails