Skip to content

Instantly share code, notes, and snippets.

@awead
Created August 22, 2014 16:26
Show Gist options
  • Select an option

  • Save awead/b2c02b24b2cd80870fbb to your computer and use it in GitHub Desktop.

Select an option

Save awead/b2c02b24b2cd80870fbb to your computer and use it in GitHub Desktop.
irb(main):001:0> f = GenericFile.new
LocalAuthority Load (0.1ms) SELECT "local_authorities".* FROM "local_authorities" WHERE "local_authorities"."name" = 'lc_subjects' LIMIT 1
LocalAuthority Load (0.1ms) SELECT "local_authorities".* FROM "local_authorities" WHERE "local_authorities"."name" = 'lexvo_languages' LIMIT 1
LocalAuthority Load (0.1ms) SELECT "local_authorities".* FROM "local_authorities" WHERE "local_authorities"."name" = 'lc_genres' LIMIT 1
Using the default fedora.yml that comes with active-fedora. If you want to override this, pass the path to fedora.yml to ActiveFedora - ie. ActiveFedora.init(:fedora_config_path => '/path/to/fedora.yml') - or set Rails.root and put fedora.yml into #{Rails.root}/config.
ActiveFedora: loading fedora config from /Users/awead/.gem/ruby/2.1.1/bundler/gems/active_fedora-331a64092daf/config/fedora.yml
Using the default fedora.yml that comes with active-fedora. If you want to override this, pass the path to fedora.yml to ActiveFedora - ie. ActiveFedora.init(:fedora_config_path => '/path/to/fedora.yml') - or set Rails.root and put fedora.yml into #{Rails.root}/config.
ActiveFedora: loading solr config from /Users/awead/.gem/ruby/2.1.1/bundler/gems/active_fedora-331a64092daf/config/solr.yml
(Object doesn't support #inspect)
=>
irb(main):002:0> f.title << "My Title"
=> nil
irb(main):003:0> f.apply_depositor_metadata "awead"
=> true
irb(main):004:0> f.save
HTTP HEAD (108.12ms) http://127.0.0.1:8983/fedora/rest/dev/61/08/vm/35/6108vm35h
Response status Net::HTTPNotFound (404)
HTTP HEAD (4.48ms) http://127.0.0.1:8983/fedora/rest/dev/61/08/vm/35/6108vm35h
Response status Net::HTTPNotFound (404)
HTTP HEAD (5.50ms) http://127.0.0.1:8983/fedora/rest/dev/61/08/vm/35/6108vm35h
Response status Net::HTTPNotFound (404)
HTTP HEAD (3.85ms) http://127.0.0.1:8983/fedora/rest/dev/61/08/vm/35/6108vm35h
Response status Net::HTTPNotFound (404)
HTTP PUT (375.73ms) http://127.0.0.1:8983/fedora/rest/dev/61/08/vm/35/6108vm35h
Request body
[
<http://fedora.info/definitions/v4/rels-ext#hasModel> "GenericFile";
<http://id.loc.gov/vocabulary/relators/dpt> "awead"
] .
Response status Net::HTTPCreated (201)
Response body http://127.0.0.1:8983/fedora/rest/dev/61/08/vm/35/6108vm35h
HTTP HEAD (6.04ms) http://127.0.0.1:8983/fedora/rest/dev/61/08/vm/35/6108vm35h/characterization
Response status Net::HTTPNotFound (404)
HTTP HEAD (4.14ms) http://127.0.0.1:8983/fedora/rest/dev/61/08/vm/35/6108vm35h/rightsMetadata
Response status Net::HTTPNotFound (404)
HTTP HEAD (3.78ms) http://127.0.0.1:8983/fedora/rest/dev/61/08/vm/35/6108vm35h/descMetadata
Response status Net::HTTPNotFound (404)
NoMethodError: undefined method `value' for #<RDF::Node:0x3ffd07aab6a0(_:g70355987904160)>
from /Users/awead/.gem/ruby/2.1.1/bundler/gems/active_fedora-331a64092daf/lib/active_fedora/rdf/rdf_datastream.rb:48:in `digital_object='
from /Users/awead/.gem/ruby/2.1.1/bundler/gems/active_fedora-331a64092daf/lib/active_fedora/persistence.rb:165:in `block in assign_uri_to_datastreams'
from /Users/awead/.gem/ruby/2.1.1/bundler/gems/active_fedora-331a64092daf/lib/active_fedora/persistence.rb:164:in `assign_uri_to_datastreams'
from /Users/awead/.gem/ruby/2.1.1/bundler/gems/active_fedora-331a64092daf/lib/active_fedora/persistence.rb:132:in `create_record'
from /Users/awead/.gem/ruby/2.1.1/bundler/gems/active_fedora-331a64092daf/lib/active_fedora/callbacks.rb:237:in `block (2 levels) in create_record'
from /Users/awead/.gem/ruby/2.1.1/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:113:in `call'
from /Users/awead/.gem/ruby/2.1.1/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:113:in `call'
from /Users/awead/.gem/ruby/2.1.1/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:299:in `block (2 levels) in halting'
from /Users/awead/Projects/Github/projecthydra/sufia/sufia-models/app/models/concerns/sufia/generic_file.rb:40:in `retry_warming'
from /Users/awead/.gem/ruby/2.1.1/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:424:in `block in make_lambda'
from /Users/awead/.gem/ruby/2.1.1/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:298:in `call'
from /Users/awead/.gem/ruby/2.1.1/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:298:in `block in halting'
from /Users/awead/.gem/ruby/2.1.1/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:166:in `call'
from /Users/awead/.gem/ruby/2.1.1/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:166:in `block in halting'
from /Users/awead/.gem/ruby/2.1.1/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:166:in `call'
from /Users/awead/.gem/ruby/2.1.1/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:166:in `block in halting'
... 8 levels...
from /Users/awead/.gem/ruby/2.1.1/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:113:in `call'
from /Users/awead/.gem/ruby/2.1.1/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
from /Users/awead/.gem/ruby/2.1.1/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:86:in `call'
from /Users/awead/.gem/ruby/2.1.1/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:86:in `run_callbacks'
from /Users/awead/.gem/ruby/2.1.1/bundler/gems/active_fedora-331a64092daf/lib/active_fedora/callbacks.rb:236:in `create_record'
from /Users/awead/.gem/ruby/2.1.1/bundler/gems/active_fedora-331a64092daf/lib/active_fedora/persistence.rb:28:in `save'
from /Users/awead/.gem/ruby/2.1.1/bundler/gems/active_fedora-331a64092daf/lib/active_fedora/validations.rb:50:in `save'
from /Users/awead/.gem/ruby/2.1.1/bundler/gems/active_fedora-331a64092daf/lib/active_fedora/versionable.rb:31:in `save'
from (irb):4
from /Users/awead/.gem/ruby/2.1.1/gems/railties-4.1.4/lib/rails/commands/console.rb:90:in `start'
from /Users/awead/.gem/ruby/2.1.1/gems/railties-4.1.4/lib/rails/commands/console.rb:9:in `start'
from /Users/awead/.gem/ruby/2.1.1/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:69:in `console'
from /Users/awead/.gem/ruby/2.1.1/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /Users/awead/.gem/ruby/2.1.1/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'irb(main):005:0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment