gpt4 book ai didi

ruby-on-rails - 在 env.rb 之外需要 Cucumber-rails。其余的加载被推迟到 env.rb 被调用

转载 作者:数据小太阳 更新时间:2023-10-29 06:29:27 28 4
gpt4 key购买 nike

请问这个env.rb错误是什么意思?

root# rake db:migrate
WARNING: Cucumber-rails required outside of env.rb. The rest of loading is being defered until env.rb is called.
To avoid this warning, move 'gem cucumber-rails' under only group :test in your Gemfile

gemfile 在这里:

source 'http://rubygems.org'

gem 'rails', '3.1.0'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

# for Heroku deployment - as described in Ap. A of ELLS book
group :development, :test do
gem 'sqlite3'
gem 'ruby-debug19', :require => 'ruby-debug'
gem 'cucumber-rails'
gem 'cucumber-rails-training-wheels'
gem 'database_cleaner'
gem 'capybara'
gem 'launchy'
end
group :production do
# gem 'pg'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'therubyracer'
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
end

gem 'jquery-rails'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
gem 'haml'

最佳答案

这就是打包器的工作原理,您需要在 gem 'cucumber-rails' 之后添加 :require => false。我不得不说错误消息有点误导。

关于ruby-on-rails - 在 env.rb 之外需要 Cucumber-rails。其余的加载被推迟到 env.rb 被调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9781456/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com