mjswartz
mjswartz

Reputation: 743

web-console warning is preventing me from testing my rails app

When I run bundle exec rake test in my rails app, I get the following message

Web Console is activated in the test environment, which 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 the test environment (and know
what you are doing), put this in your Rails application
configuration:

    config.web_console.development_only = false

However my Gemfile has web-console in both the test and the development environment

group :development, :test do
  gem 'sqlite3'
  gem 'byebug'
  gem 'web-console'
  gem 'spring'
end

This is exactly how I have it on my Cloud9 account which works fine, but I'm on a laptop running Ubuntu 14.04 and I'm having this issue. What's going on?

Upvotes: 2

Views: 331

Answers (1)

Chloe
Chloe

Reputation: 26264

This might be a question specifically about Cloud9, which I've not used. To fix your problem, move the 'web-console' line outside of the group, and change to

gem 'web-console', group: :development

Basically take web-console out of the :test group. Also, try just rake test. You might have forgotten bundle update too.

Upvotes: 1

Related Questions