web-console警告阻止我测试我的rails应用程序

时间:2016-04-15 22:56:48

标签: ruby-on-rails ubuntu-14.04 gemfile web-console

当我在我的rails应用程序中运行bundle exec rake test时,我收到以下消息

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

但是我的Gemfile在测试和开发环境中都有web控制台

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

这正是我在我的Cloud9帐户上运行良好的方式,但我在运行Ubuntu 14.04的笔记本电脑上,我遇到了这个问题。发生了什么事?

1 个答案:

答案 0 :(得分:1)

这可能是一个特别关于Cloud9的问题,我没有使用过。要解决您的问题,请将“网络控制台”行移到该组之外,然后更改为

gem 'web-console', group: :development

基本上从web-console组中取出:test。另外,请尝试rake test。您可能也忘记了bundle update