2

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?

mjswartz
  • 715
  • 1
  • 6
  • 19

1 Answers1

1

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.

Chloe
  • 25,162
  • 40
  • 190
  • 357
  • If I do this and run `rake test`, I get the error output `Running via Spring preloader in process 5329 /usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require': cannot load such file -- guard (LoadError)` (with more junk after) – mjswartz Apr 16 '16 at 00:24
  • Can you post your whole `Gemfile`? Are you using `guard`? Can you move `guard` into the `:development` group? It doesn't need to be in `:test`. – Chloe Apr 17 '16 at 03:35