Explore Running Rails Server Environment from Console
irb, rails-console, ruby-on-rails
Solution
You can't do this with vanilla Rails. Each time you type `rails` (whether with `server` or `console`), you're booting a brand new instance of your application, which shares no state with any other instance.
However, if you install the extremely useful Pry gem, you can type `binding.pry` at any point in your application (inside an action or model or view). When program flow hits your `binding.pry`, the server instance will drop into an interactive shell, and you can inspect the state of your server process. This is about as close as you can get to what you're trying to do.
Problem
I have an app, and I have it running locally. I can create another version of the app in `rails console`, however I want to have a command line interface for the app that is running that I can interact with both in the web interface and the console. Ideally I fire up `rails s` and then can play with the variables in that environment.