Skip to content

Instantly share code, notes, and snippets.

@younga3
Created January 30, 2020 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save younga3/483ca481e6f6c91725dee39b25a51d45 to your computer and use it in GitHub Desktop.
Save younga3/483ca481e6f6c91725dee39b25a51d45 to your computer and use it in GitHub Desktop.
Error on fresh vagrant box.
[vagrant@localhost current]$ sudo su - deploy
[deploy@localhost ~]$ cd /opt/oars/current
[deploy@localhost current]$ RAILS_ENV=production bundle exec rake hyrax:default_collection_types:create
Default collection type is user_collection
Default collection type is admin_set
[deploy@localhost current]$ RAILS_ENV=production bundle exec rake hyrax:default_admin_set:create
Successfully created default admin set
[deploy@localhost current]$ RAILS_ENV=production bundle exec rake hyrax:workflow:load
I, [2020-01-30T22:21:52.456050 #24648] INFO -- : Loading permission_template ID=1 with workflow config /opt/oars/release
s/20200130T214929/config/workflows/default_workflow.json
I, [2020-01-30T22:21:52.607913 #24648] INFO -- : Loading permission_template ID=1 with workflow config /opt/oars/release
s/20200130T214929/config/workflows/mediated_deposit_workflow.json
[deploy@localhost current]$ RAILS_ENV=production bundle exec rails generate roles
Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.3). We suggest y
ou to upgrade to the version that created the lockfile by running `gem install bundler:2.1.3`.
create db/migrate/20200130222506_user_roles.rb
insert app/models/user.rb
[deploy@localhost current]$ RAILS_ENV=production bundle exec rails db:migrate
Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.3). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.1.3`.
rails aborted!
ActiveRecord::DuplicateMigrationNameError:
Multiple migrations have the name UserRoles.
/opt/oars/shared/bundle/ruby/2.6.0/gems/activerecord-5.1.7/lib/active_record/migration.rb:1254:in `validate'
/opt/oars/shared/bundle/ruby/2.6.0/gems/activerecord-5.1.7/lib/active_record/migration.rb:1123:in `initialize'
/opt/oars/shared/bundle/ruby/2.6.0/gems/activerecord-5.1.7/lib/active_record/migration.rb:1007:in `new'
/opt/oars/shared/bundle/ruby/2.6.0/gems/activerecord-5.1.7/lib/active_record/migration.rb:1007:in `up'
/opt/oars/shared/bundle/ruby/2.6.0/gems/activerecord-5.1.7/lib/active_record/migration.rb:985:in `migrate'
/opt/oars/shared/bundle/ruby/2.6.0/gems/activerecord-5.1.7/lib/active_record/tasks/database_tasks.rb:171:in `migrate'
/opt/oars/shared/bundle/ruby/2.6.0/gems/activerecord-5.1.7/lib/active_record/railties/databases.rake:58:in `block (2 levels) in <top (required)>'
/opt/oars/shared/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/commands/rake/rake_command.rb:21:in `block in perform'
/opt/oars/shared/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/opt/oars/shared/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/command.rb:46:in `invoke'
/opt/oars/shared/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/commands.rb:16:in `<top (required)>'
bin/rails:9:in `require'
bin/rails:9:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
[deploy@localhost current]$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment