{"action":"closed","issue":{"url":"https://api.github.com/repos/rails/rails/issues/20039","labels_url":"https://api.github.com/repos/rails/rails/issues/20039/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/20039/comments","events_url":"https://api.github.com/repos/rails/rails/issues/20039/events","html_url":"https://github.com/rails/rails/issues/20039","id":73446387,"number":20039,"title":"Rails Console Doesn't Appear to Honor Environment Argument","user":{"login":"todd","id":120350,"avatar_url":"https://avatars.githubusercontent.com/u/120350?v=3","gravatar_id":"","url":"https://api.github.com/users/todd","html_url":"https://github.com/todd","followers_url":"https://api.github.com/users/todd/followers","following_url":"https://api.github.com/users/todd/following{/other_user}","gists_url":"https://api.github.com/users/todd/gists{/gist_id}","starred_url":"https://api.github.com/users/todd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/todd/subscriptions","organizations_url":"https://api.github.com/users/todd/orgs","repos_url":"https://api.github.com/users/todd/repos","events_url":"https://api.github.com/users/todd/events{/privacy}","received_events_url":"https://api.github.com/users/todd/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rails/rails/labels/railties","name":"railties","color":"8BE06E"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/rails/rails/milestones/40","html_url":"https://github.com/rails/rails/milestones/4.2.2","labels_url":"https://api.github.com/repos/rails/rails/milestones/40/labels","id":988887,"number":40,"title":"4.2.2","description":"","creator":{"login":"rafaelfranca","id":47848,"avatar_url":"https://avatars.githubusercontent.com/u/47848?v=3","gravatar_id":"","url":"https://api.github.com/users/rafaelfranca","html_url":"https://github.com/rafaelfranca","followers_url":"https://api.github.com/users/rafaelfranca/followers","following_url":"https://api.github.com/users/rafaelfranca/following{/other_user}","gists_url":"https://api.github.com/users/rafaelfranca/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaelfranca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaelfranca/subscriptions","organizations_url":"https://api.github.com/users/rafaelfranca/orgs","repos_url":"https://api.github.com/users/rafaelfranca/repos","events_url":"https://api.github.com/users/rafaelfranca/events{/privacy}","received_events_url":"https://api.github.com/users/rafaelfranca/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":16,"state":"open","created_at":"2015-02-20T21:21:55Z","updated_at":"2015-05-07T19:56:56Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-05-05T22:09:23Z","updated_at":"2015-05-07T19:56:56Z","closed_at":"2015-05-07T19:56:56Z","body":"Noticed this while debugging a separate issue while upgrading one of our apps to Rails 4.2.1. Starting a Rails console in a non-development environment by specifying the environment as a command argument doesn't appear to load the correct configuration for that environment.\r\n\r\nHere's a snippet from our `staging.rb`:\r\n```ruby\r\nRails.application.configure do\r\n  # ...  \r\n  config.eager_load = true\r\n  # ...\r\nend\r\n```\r\n\r\nAnd here's some output from a staging environment Rails console:\r\n```\r\n$ bundle exec rails c staging\r\nLoading staging environment (Rails 4.2.1)\r\n[1] pry(main)> Rails.application.config.eager_load\r\n=> false\r\n```\r\n\r\nHowever, specifying the environment through `ENV` works as expected.\r\n```\r\n$ RAILS_ENV=staging bundle exec rails c\r\nLoading staging environment (Rails 4.2.1)\r\nSTAGING [1] pry(main)> Rails.application.config.eager_load\r\n=> true\r\n```\r\n\r\nIs the former behavior no longer supported? I'd be willing to try to track the root of this down if it's a bug."}}