2

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

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 在测试和开发环境中都有网络控制台

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

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

4

1 回答 1

1

这可能是一个专门关于 Cloud9 的问题,我没有使用过。要解决您的问题,请将“web-console”行移到组外,然后更改为

gem 'web-console', group: :development

基本上就web-console:test团了。另外,请尝试rake test. 你可能也忘记bundle update了。

于 2016-04-15T23:00:47.363 回答