Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Web console is activated in the test environment" when testing app

I'm a newbie to Rails. Therefore, apologies in advance if this is a dumb question. I have gone through Michael Heartl's book and tried coding an app myself.

I have written a few basic tests, but when trying to test the app with

$bundle exec rake test

I get the following message on the terminal

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

When I add the above to development.rb it still doesn't make a difference.

Please help me understand what I'm doing wrong.

like image 978
Lanka_ruby Avatar asked Feb 16 '16 16:02

Lanka_ruby


2 Answers

What you need to do is make sure that in your Gemfile the line gem 'web-console' is only loaded in the group development.

Can you maybe post your Gemfile? This way we can see if that is what's causing it.

In your Gemfile it should either be:

gem 'web-console', group: :development

or

group :development do
  gem 'web-console'
end
like image 85
lienvdsteen Avatar answered Sep 23 '22 22:09

lienvdsteen


In the Gem file if you have this line

gem 'web-console', '~> 2.0'

Remove it.

Then run

$ gem install bundler

$ bundle install --without production
like image 38
Mark Wollerman Avatar answered Sep 23 '22 22:09

Mark Wollerman