Read more

3 ways to run Spring (the Rails app preloader) and how to disable it

Dominik Schöler
June 26, 2014Software engineer at makandra GmbH

spring ...

The most obvious way to use spring is to call it explicitly:

spring rails console
spring rake db:migrate

Binstubs

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

Binstubs are wrapper scripts around executables. In Rails they live inside bin/. If you run spring binstub --all, your binstubs will be using Spring.

bin/rails console
bin/rake db:migrate

bundle exec rails ...

Bundle exec is inconsistent when it comes to spring. Some commands will use it, some won't.

bundle exec rails console # starts Spring
bundle exec rake # does not start Spring

Disabling Spring

You can temporarily disable Spring by setting the environment variable DISABLE_SPRING. Obviously, this does not work when calling Spring explicitly.

Posted by Dominik Schöler to makandra dev (2014-06-26 12:43)