ПРЕДУПРЕЖДЕНИЕ: Огуречные рельсы, требуемые за пределами env.rb

В принципе, я пытался использовать twitter-bootstrap-rails и devise gem в своем приложении. Однако, когда я пытаюсь сделать rake db:migrate, он продолжает жаловаться на Огурцы. Огурцы-рельсы находятся под group :development, :test в Gemfile.

Моя окружение жемчужины:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.17
  - RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-darwin11.3.0]
  - INSTALLATION DIRECTORY: /Users/user1/.rvm/gems/ruby-1.9.2-p290
  - RUBY EXECUTABLE: /Users/user1/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/user1/.rvm/gems/ruby-1.9.2-p290/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-11
  - GEM PATHS:
     - /Users/user1/.rvm/gems/ruby-1.9.2-p290
     - /Users/user1/.rvm/gems/[email protected]
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

После запуска rake db:migrate он дает мне следующее сообщение:

$ rake --trace 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
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
uninitialized constant User
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0/lib/active_support/inflector/methods.rb:226:in `block in constantize'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0/lib/active_support/inflector/methods.rb:225:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0/lib/active_support/inflector/methods.rb:225:in `constantize'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise.rb:293:in `get'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/mapping.rb:77:in `to'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/mapping.rb:72:in `modules'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/mapping.rb:89:in `routes'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/mapping.rb:156:in `default_used_route'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/mapping.rb:66:in `initialize'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise.rb:327:in `new'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise.rb:327:in `add_mapping'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/rails/routes.rb:206:in `block in devise_for'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/rails/routes.rb:205:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/rails/routes.rb:205:in `devise_for'
/Users/user1/pachamama/config/routes.rb:4:in `block in <top (required)>'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:272:in `instance_exec'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:272:in `eval_block'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:249:in `draw'
/Users/user1/pachamama/config/routes.rb:1:in `<top (required)>'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:40:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:40:in `load_paths'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:16:in `reload!'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:26:in `block in updater'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0/lib/active_support/file_update_checker.rb:78:in `call'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0/lib/active_support/file_update_checker.rb:78:in `execute'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:27:in `updater'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/finisher.rb:67:in `block in <module:Finisher>'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:30:in `instance_exec'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:30:in `run'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:54:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:54:in `run_initializers'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application.rb:136:in `initialize!'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/user1/pachamama/config/environment.rb:5:in `<top (required)>'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application.rb:103:in `require_environment!'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application.rb:292:in `block (2 levels) in initialize_tasks'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/user1/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/Users/user1/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
Tasks: TOP => db:migrate => environment

Ответ 1

Пользователь user.rb не был создан в каталоге app/models/. Это разрешит ошибку (неинициализированный постоянный пользователь). Предупреждение огурца можно решить тем, что Эндрю предложил

gem 'cucumber-rails', :require => false

или

Убедитесь, что это существует features/support/env.rb, чтобы сделать это при моей настройке:

rails g cucumber:install 
rails g cucumber:install capybara
rake cucumber

Ответ 2

Измените запись в своем Gemfile на:

gem 'cucumber-rails', :require => false

Смотрите эти проблемы: один, два.