Skip to content

Warning: no environment

Cezary Baginski edited this page Jul 10, 2015 · 2 revisions

"Warning: no environment passed"

If you're using Zeus, you need a custom plan to save/pass configuration variables (see: https://github.com/burke/zeus/issues/523).

Workaround

Create a custom Zeus plan to silence the warning:

  1. Run zeus init

  2. Edit custom_plan.rb to contain the following:

require 'zeus/rails'

class CustomPlan < Zeus::Rails
  def test(*args)
    ENV['GUARD_RSPEC_RESULTS_FILE'] = 'tmp/guard_rspec_results.txt' # can be anything matching Guard::RSpec :results_file option in the Guardfile
    super
  end
end

Zeus.plan = CustomPlan.new
  1. Restart the zeus server (so it can reload the custom plan)

  2. Fool Guard::RSpec into thinking it's config is being honored by setting a matching results file in the Guardfile:

rspec_options = {
  results_file: 'tmp/guard_rspec_results.txt', # << add this option to match above path in custom_plan.rb
  cmd: "zeus rspec",
  all_after_pass: true,
  failed_mode: :focus
}

guard :rspec, rspec_options do
# (...)

Troubleshooting

Clone this wiki locally