From 70b6b2be4e6afc54a8ac6f495562033a0d1907b5 Mon Sep 17 00:00:00 2001 From: Tom Hipkin Date: Fri, 23 Sep 2022 13:11:17 +0100 Subject: [PATCH] Application starts in production mode When starting the application with RAILS_ENV=production mode and we run `rake` we get an error that explains we don't have standard installed. This is correct as out gemfile specifies that we only install standard in the dev and test environments. This change only tries to load the standard rake task when in the dev or test environment. Other take tasks such as `rails db:prepare` can still run in any environment as normal. --- Rakefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index 52ad86b5..14d36fcc 100644 --- a/Rakefile +++ b/Rakefile @@ -7,5 +7,7 @@ require_relative "config/application" Rails.application.load_tasks -desc "Run all the tests" -task default: %i[spec standard] +if Rails.env.development? || Rails.env.test? + desc "Run all the tests" + task default: %i[spec standard] +end