How can I run the Ruby on Rails console in production without executing Spring?

Put springin your testing group in the Gemfile:

gem "spring", group: :test

or

group :test do
 gem 'spring'
end

I found it. You need to set the environment variable DISABLE_SPRING to true when executing the console, like this:

DISABLE_SPRING=true rails console

That way the Spring server will not load.

To do this automatically, you can export this variable in your .bashrc, .tcshrc, .zshrc appending this code to it:

export DISABLE_SPRING=true

and then loading it, in my case (I'm using zsh):

source ~/.zshrc

Reference:

https://github.com/rails/spring

http://www.cyberciti.biz/faq/linux-unix-shell-export-command/