Closed ideas-into-software closed 2 years ago
I'm a bit rusty with ruby, but this seems to have to do with the fact that the method trying to be called core_template_source
, is defined in a different file than that one that is actually be included. The function is here in lib/terraspace/cli/new/plugin/helper.rb
, but the there is another file in lib/terraspace/cli/new/helpers.rb
that is actually getting included when include Helpers
is called in plugin.rb .
To work around this, I manually copied the core_template_source
function definition into the file lib/terraspace/cli/new/helpers.rb
and that removed the error for me.
What the actual correct thing to do is to submit a PR, I don't know, but maybe that gives someone with more experience a better clue to figure out how to solve the problem.
Cheers.
I have a similar error in my environment. But for me this error comes for every command I try
I have worked with terraspace end of april. Now I wanted to destroy everything but terraspace is not working anymore. The onle thing which was changed is the version of terraspace (apt-get). I tried to downgrade to the oldest available version without success.
Mine from april (0.6.6-20210425100245
) is not available anymore
Building one of the modules to get backend.tf info
Traceback (most recent call last):
22: from /opt/terraspace/embedded/bin/terraspace:23:in `<main>'
21: from /opt/terraspace/embedded/bin/terraspace:23:in `load'
20: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/terraspace-0.6.6/exe/terraspace:14:in `<top (required)>'
19: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor/base.rb:485:in `start'
18: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/terraspace-0.6.6/lib/terraspace/command.rb:59:in `dispatch'
17: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
16: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
15: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
14: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/terraspace-0.6.6/lib/terraspace/cli.rb:178:in `summary'
13: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/terraspace-0.6.6/lib/terraspace/cli/summary.rb:14:in `run'
12: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/terraspace-0.6.6/lib/terraspace/cli/summary.rb:25:in `build_placeholder'
11: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/terraspace-0.6.6/lib/terraspace/cli/build/placeholder.rb:23:in `build'
10: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/terraspace-0.6.6/lib/terraspace/builder.rb:13:in `run'
9: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/terraspace-0.6.6/lib/terraspace/builder.rb:77:in `clean'
8: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/terraspace-0.6.6/lib/terraspace/compiler/cleaner.rb:9:in `clean'
7: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/terraspace-0.6.6/lib/terraspace/compiler/cleaner.rb:16:in `backend_change_purge'
6: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/terraspace-0.6.6/lib/terraspace/compiler/cleaner/backend_change.rb:10:in `purge'
5: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/terraspace-0.6.6/lib/terraspace/compiler/cleaner/backend_change.rb:20:in `purge?'
4: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/terraspace-0.6.6/lib/terraspace/compiler/cleaner/backend_change.rb:34:in `current_backend'
3: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/memoist-0.16.2/lib/memoist.rb:169:in `cache_dir'
2: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/terraspace-0.6.6/lib/terraspace/mod.rb:130:in `cache_dir'
1: from /opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/memoist-0.16.2/lib/memoist.rb:213:in `autodetect'
/opt/terraspace/embedded/lib/ruby/gems/2.7.0/gems/terraspace-0.6.6/lib/terraspace/compiler/expander.rb:26:in `autodetect': undefined method `[]' for nil:NilClass (NoMethodError)
Edit:
For me it was the missing Gemfile
My Environment
Expected Behaviour
Skeleton for new plugin created.
Current Behavior
'terraspace new plugin' throws 'NoMethodError'
Step-by-step reproduction instructions