Skip to content

"Web Console is activated in the test environment. This is usually a mistake." #729

@ndbroadbent

Description

@ndbroadbent

I was previously just using rspec to run my tests, but I've just switched to parallel_tests, and now I'm running into this error when I'm calling the rake task:

$ rake parallel:spec
Web Console is activated in the test environment. This is
usually a mistake. To ensure it's only activated in development
mode, move it to the development group of your Gemfile:

    gem 'web-console', group: :development

If you still want to run it in the test environment (and know
what you are doing), put this in your Rails application
configuration:

    config.web_console.development_only = false

My Gemfile does have the web-console gem in the development group, but I think the initial rake command assumes that the Rails env is development so it loads all of the gems in this group.

There's a few ways I can fix this:

  • Run the parallel_rspec command directly
  • Run RAILS_ENV=test rake parallel:spec
    • Maybe I could shorten this by setting up an alias for my bash profile.
  • Set config.web_console.development_only = false in my application config

I think I'll just use the parallel_rspec command, but I was wondering how people normally resolve this issue? (And maybe something could be added to the README? I'm just not sure about the best solution.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions