Skip to content

Instantly share code, notes, and snippets.

@escowles
Last active November 2, 2016 12:59
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 escowles/c5f1b505954ab368fa659614a2a85610 to your computer and use it in GitHub Desktop.
Save escowles/c5f1b505954ab368fa659614a2a85610 to your computer and use it in GitHub Desktop.
fixing an invalid seed

Problem: I want to migrate minter state from a minter statefile to the database, but keep getting errors like:

NoMethodError (private method `select' called for nil:NilClass):

and

NoMethodError (method `update_attributes' called for nil:NilClass):

Solution: Generate a new seed and then migrate the minter state to the database

  1. manually delete the invalid seed

    psql -U dbuser -W -h dbhost -c 'delete from minter_states;' dbname
  2. generate a new seed

    RAILS_ENV=staging bundle exec rails generate active_fedora:noid:seed
  3. migrate the minter state from a file to the database

    RAILS_ENV=staging bundle exec rake active_fedora:noid:migrate_file_to_database
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment