Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating Elements #21

Closed
askl56 opened this issue Jan 13, 2018 · 4 comments
Closed

Generating Elements #21

askl56 opened this issue Jan 13, 2018 · 4 comments

Comments

@askl56
Copy link

askl56 commented Jan 13, 2018

Hey,

I'm following the Readme and when I add

- name: product
  contents:
  - name: spree_product
    type: EssenceSpreeProduct

- name: product_category
  contents:
  - name: spree_taxon
    type: EssenceSpreeTaxon

to elements.yml then run rails g alchemy:elements --skip I get the following error:

Running via Spring preloader in process 72412
Traceback (most recent call last):
	76: from -e:1:in `<main>'
	75: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	74: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	73: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `load'
	72: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
	71: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `block in load'
	70: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `load'
	69: from /Users/ams/Dropbox/code/bolt/bolt-dummy-store/bin/rails:9:in `<top (required)>'
	68: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
	67: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
	66: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
	65: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
	64: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
	63: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>'
	62: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
	61: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
	60: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
	59: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
	58: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
	57: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.4/lib/rails/commands/generate/generate_command.rb:24:in `perform'
	56: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.4/lib/rails/generators.rb:269:in `invoke'
	55: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
	54: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/group.rb:232:in `dispatch'
	53: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `invoke_all'
	52: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `map'
	51: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `each'
	50: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `block in invoke_all'
	49: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
	48: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
	47: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/alchemy_cms-4.0.0/lib/rails/generators/alchemy/elements/elements_generator.rb:10:in `create_partials'
	46: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/alchemy_cms-4.0.0/lib/rails/generators/alchemy/base.rb:35:in `load_alchemy_yaml'
	45: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych.rb:325:in `safe_load'
	44: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:32:in `accept'
	43: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/visitor.rb:6:in `accept'
	42: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/visitor.rb:16:in `visit'
	41: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:311:in `visit_Psych_Nodes_Document'
	40: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:32:in `accept'
	39: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/visitor.rb:6:in `accept'
	38: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/visitor.rb:16:in `visit'
	37: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:141:in `visit_Psych_Nodes_Sequence'
	36: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:330:in `register_empty'
	35: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:330:in `each'
	34: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:330:in `block in register_empty'
	33: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:32:in `accept'
	32: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/visitor.rb:6:in `accept'
	31: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/visitor.rb:16:in `visit'
	30: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:162:in `visit_Psych_Nodes_Mapping'
	29: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:336:in `revive_hash'
	28: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:336:in `each_slice'
	27: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:336:in `each'
	26: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:338:in `block in revive_hash'
	25: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:32:in `accept'
	24: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/visitor.rb:6:in `accept'
	23: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/visitor.rb:16:in `visit'
	22: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:141:in `visit_Psych_Nodes_Sequence'
	21: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:330:in `register_empty'
	20: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:330:in `each'
	19: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:330:in `block in register_empty'
	18: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:32:in `accept'
	17: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/visitor.rb:6:in `accept'
	16: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/visitor.rb:16:in `visit'
	15: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:162:in `visit_Psych_Nodes_Mapping'
	14: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:336:in `revive_hash'
	13: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:336:in `each_slice'
	12: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:336:in `each'
	11: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:338:in `block in revive_hash'
	10: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:32:in `accept'
	 9: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/visitor.rb:6:in `accept'
	 8: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/visitor.rb:16:in `visit'
	 7: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:123:in `visit_Psych_Nodes_Scalar'
	 6: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/visitors/to_ruby.rb:60:in `deserialize'
	 5: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/scalar_scanner.rb:83:in `tokenize'
	 4: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/class_loader.rb:82:in `symbolize'
	 3: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/class_loader.rb:32:in `symbolize'
	 2: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/class_loader.rb:39:in `block (2 levels) in <class:ClassLoader>'
	 1: from /Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/class_loader.rb:28:in `load'
/Users/ams/.rbenv/versions/2.5.0/lib/ruby/2.5.0/psych/class_loader.rb:97:in `find': Tried to load unspecified class: Symbol (Psych::DisallowedClass)

Any idea why?

@askl56
Copy link
Author

askl56 commented Jan 13, 2018

For reference, here is my full elements.yml

# == In this configuration, you set up Alchemy's element layouts.
#
# For further information please see http://guides.alchemy-cms.com/stable/elements.html

- name: article
  hint: true
  unique: true
  contents:
  - name: headline
    type: EssenceText
    default: :article_headline
    hint: true
  - name: picture
    type: EssencePicture
    hint: true
  - name: text
    type: EssenceRichtext
    default: :article_text
    hint: true

- name: product
  contents:
  - name: spree_product
    type: EssenceSpreeProduct

- name: product_category
  contents:
  - name: spree_taxon
    type: EssenceSpreeTaxon

@askl56
Copy link
Author

askl56 commented Jan 13, 2018

Wondering if it's related to this? https://github.com/AlchemyCMS/alchemy_cms/pull/1333/files

@tvdeyen
Copy link
Member

tvdeyen commented Jan 13, 2018

Yes. This is fixed with AlchemyCMS/alchemy_cms#1333.

For a quick fix you can remove the Symbols from the elements.yml

@tvdeyen
Copy link
Member

tvdeyen commented Jan 13, 2018

As this is not an issue with this gem I will close this issue

@tvdeyen tvdeyen closed this as completed Jan 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants