foreman with mongoid_rails_migrations in rails 5 projects doesn't work
Closed this issue · 2 comments
wulffeld commented
Steps to reproduce:
- Create a standard rails 5 project.
- Add this gem, mongoid and foreman to the project.
- Add Procfile in root of project with contents:
worker: bundle exec rake db:migrate
- Run
bundle exec foreman start
Stacktrace:
13:20:48 worker.1 | started with pid 85087
13:20:51 worker.1 | /Users/m/.rbenv/versions/2.2.5/lib/ruby/2.2.0/json/version.rb:3: warning: already initialized constant JSON::VERSION
13:20:51 worker.1 | /Users/m/.bundler/gems/json-2.0.3/lib/json/version.rb:4: warning: previous definition of VERSION was here
13:20:51 worker.1 | /Users/m/.rbenv/versions/2.2.5/lib/ruby/2.2.0/json/version.rb:4: warning: already initialized constant JSON::VERSION_ARRAY
13:20:51 worker.1 | /Users/m/.bundler/gems/json-2.0.3/lib/json/version.rb:5: warning: previous definition of VERSION_ARRAY was here
13:20:51 worker.1 | /Users/m/.rbenv/versions/2.2.5/lib/ruby/2.2.0/json/version.rb:5: warning: already initialized constant JSON::VERSION_MAJOR
13:20:51 worker.1 | /Users/m/.bundler/gems/json-2.0.3/lib/json/version.rb:6: warning: previous definition of VERSION_MAJOR was here
13:20:51 worker.1 | /Users/m/.rbenv/versions/2.2.5/lib/ruby/2.2.0/json/version.rb:6: warning: already initialized constant JSON::VERSION_MINOR
13:20:51 worker.1 | /Users/m/.bundler/gems/json-2.0.3/lib/json/version.rb:7: warning: previous definition of VERSION_MINOR was here
13:20:51 worker.1 | /Users/m/.rbenv/versions/2.2.5/lib/ruby/2.2.0/json/version.rb:7: warning: already initialized constant JSON::VERSION_BUILD
13:20:51 worker.1 | /Users/m/.bundler/gems/json-2.0.3/lib/json/version.rb:8: warning: previous definition of VERSION_BUILD was here
13:20:51 worker.1 | /Users/m/.rbenv/versions/2.2.5/lib/ruby/2.2.0/json/common.rb:99: warning: already initialized constant JSON::NaN
13:20:51 worker.1 | /Users/m/.bundler/gems/json-2.0.3/lib/json/common.rb:100: warning: previous definition of NaN was here
13:20:51 worker.1 | /Users/m/.rbenv/versions/2.2.5/lib/ruby/2.2.0/json/common.rb:101: warning: already initialized constant JSON::Infinity
13:20:51 worker.1 | /Users/m/.bundler/gems/json-2.0.3/lib/json/common.rb:102: warning: previous definition of Infinity was here
13:20:51 worker.1 | /Users/m/.rbenv/versions/2.2.5/lib/ruby/2.2.0/json/common.rb:103: warning: already initialized constant JSON::MinusInfinity
13:20:51 worker.1 | /Users/m/.bundler/gems/json-2.0.3/lib/json/common.rb:104: warning: previous definition of MinusInfinity was here
13:20:51 worker.1 | /Users/m/.rbenv/versions/2.2.5/lib/ruby/2.2.0/json/common.rb:128: warning: already initialized constant JSON::UnparserError
13:20:51 worker.1 | /Users/m/.bundler/gems/json-2.0.3/lib/json/common.rb:129: warning: previous definition of UnparserError was here
13:20:51 worker.1 | rake aborted!
13:20:51 worker.1 | LoadError: cannot load such file -- active_model/naming
13:20:51 worker.1 | /Users/m/.bundler/gems/activemodel-5.0.2/lib/active_model/validations.rb:42:in `block in <module:Validations>'
13:20:51 worker.1 | /Users/m/.bundler/gems/activesupport-5.0.2/lib/active_support/concern.rb:120:in `class_eval'
13:20:51 worker.1 | /Users/m/.bundler/gems/activesupport-5.0.2/lib/active_support/concern.rb:120:in `append_features'
13:20:51 worker.1 | /Users/m/.bundler/gems/activesupport-5.0.2/lib/active_support/concern.rb:117:in `include'
13:20:51 worker.1 | /Users/m/.bundler/gems/activesupport-5.0.2/lib/active_support/concern.rb:117:in `block in append_features'
13:20:51 worker.1 | /Users/m/.bundler/gems/activesupport-5.0.2/lib/active_support/concern.rb:117:in `each'
13:20:51 worker.1 | /Users/m/.bundler/gems/activesupport-5.0.2/lib/active_support/concern.rb:117:in `append_features'
13:20:51 worker.1 | /Users/m/.bundler/gems/activesupport-5.0.2/lib/active_support/concern.rb:117:in `include'
13:20:51 worker.1 | /Users/m/.bundler/gems/activesupport-5.0.2/lib/active_support/concern.rb:117:in `block in append_features'
13:20:51 worker.1 | /Users/m/.bundler/gems/activesupport-5.0.2/lib/active_support/concern.rb:117:in `each'
13:20:51 worker.1 | /Users/m/.bundler/gems/activesupport-5.0.2/lib/active_support/concern.rb:117:in `append_features'
13:20:51 worker.1 | /Users/m/.bundler/gems/activesupport-5.0.2/lib/active_support/concern.rb:117:in `include'
13:20:51 worker.1 | /Users/m/.bundler/gems/activesupport-5.0.2/lib/active_support/concern.rb:117:in `block in append_features'
13:20:51 worker.1 | /Users/m/.bundler/gems/activesupport-5.0.2/lib/active_support/concern.rb:117:in `each'
13:20:51 worker.1 | /Users/m/.bundler/gems/activesupport-5.0.2/lib/active_support/concern.rb:117:in `append_features'
13:20:51 worker.1 | /Users/m/.bundler/gems/mongoid_rails_migrations-1.1.0/lib/mongoid_rails_migrations/models/data_migration.rb:2:in `include'
13:20:51 worker.1 | /Users/m/.bundler/gems/mongoid_rails_migrations-1.1.0/lib/mongoid_rails_migrations/models/data_migration.rb:2:in `<class:DataMigration>'
13:20:51 worker.1 | /Users/m/.bundler/gems/mongoid_rails_migrations-1.1.0/lib/mongoid_rails_migrations/models/data_migration.rb:1:in `<top (required)>'
13:20:51 worker.1 | /Users/m/.bundler/gems/mongoid_rails_migrations-1.1.0/lib/mongoid_rails_migrations.rb:10:in `require'
13:20:51 worker.1 | /Users/m/.bundler/gems/mongoid_rails_migrations-1.1.0/lib/mongoid_rails_migrations.rb:10:in `<top (required)>'
13:20:51 worker.1 | /Users/m/projects/rails5/testapp/config/application.rb:7:in `<top (required)>'
13:20:51 worker.1 | /Users/m/projects/rails5/testapp/Rakefile:4:in `require_relative'
13:20:51 worker.1 | /Users/m/projects/rails5/testapp/Rakefile:4:in `<top (required)>'
13:20:51 worker.1 | /Users/m/.bundler/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
13:20:51 worker.1 | /Users/m/.rbenv/versions/2.2.5/bin/bundle:23:in `load'
13:20:51 worker.1 | /Users/m/.rbenv/versions/2.2.5/bin/bundle:23:in `<main>'
13:20:51 worker.1 | (See full trace by running task with --trace)
13:20:52 worker.1 | exited with code 1
13:20:52 system | sending SIGTERM to all processes
nitvik commented
Try removing foreman from Gemfile and install it by gem install foreman instead.