0

I have set up a bunch of initialising tasks that call various APIs and save them to constants for access in my controller (this may well be bad form, but I don't need them saved to the database for now).

Is there any way to run

rails s

without initializers, such as a setting up a specific environment that ignores them, or would this be bad practice?

Jonathan_W
  • 638
  • 9
  • 24

1 Answers1

1

There are option to group initializers and then run only certains of them (see this answer), but if this is a temporary situation, you have a lot of options:

  • Just comment out the ones you don't need (if this is just a test on your machine)
  • Add a if Rails.env.development? clause to those you don't want to run locally (if this is for all development environments)
Community
  • 1
  • 1
Martin
  • 7,634
  • 1
  • 20
  • 23