Skip to content
This repository has been archived by the owner on Jun 28, 2019. It is now read-only.

V1.1.2 - YAML parsing error => TypeError: no implicit conversion of ERB into String #80

Open
pRdm opened this issue Apr 30, 2018 · 1 comment

Comments

@pRdm
Copy link

pRdm commented Apr 30, 2018

I've recently upgraded cap-ec2 from 1.0.0 to 1.1.2. And started getting this:

** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
cap aborted!
TypeError: no implicit conversion of ERB into String
/Users/pRdm/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/psych.rb:377:in `parse'
/Users/pRdm/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/psych.rb:377:in `parse_stream'
/Users/pRdm/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/psych.rb:325:in `parse'
/Users/pRdm/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/psych.rb:252:in `load'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/cap-ec2-1.1.2/lib/cap-ec2/utils.rb:59:in `load_config'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/cap-ec2-1.1.2/lib/cap-ec2/ec2-handler.rb:8:in `initialize'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/cap-ec2-1.1.2/lib/cap-ec2/capistrano.rb:18:in `new'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/cap-ec2-1.1.2/lib/cap-ec2/capistrano.rb:18:in `ec2_handler'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/cap-ec2-1.1.2/lib/cap-ec2/capistrano.rb:22:in `ec2_role'
config/deploy/production.rb:7:in `block in <top (required)>'
config/deploy/production.rb:6:in `each'
config/deploy/production.rb:6:in `<top (required)>'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/capistrano-3.10.2/lib/capistrano/setup.rb:28:in `load'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/capistrano-3.10.2/lib/capistrano/setup.rb:28:in `block (3 levels) in <top (required)>'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/capistrano-3.10.2/lib/capistrano/configuration/variables.rb:32:in `untrusted!'
/Users/pRdm/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/delegate.rb:83:in `method_missing'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/capistrano-3.10.2/lib/capistrano/setup.rb:26:in `block (2 levels) in <top (required)>'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/rake-12.3.1/lib/rake/task.rb:271:in `block in execute'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/rake-12.3.1/lib/rake/task.rb:271:in `each'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/rake-12.3.1/lib/rake/task.rb:271:in `execute'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/rake-12.3.1/lib/rake/task.rb:213:in `block in invoke_with_call_chain'
/Users/pRdm/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/rake-12.3.1/lib/rake/task.rb:193:in `invoke_with_call_chain'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/rake-12.3.1/lib/rake/task.rb:182:in `invoke'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/rake-12.3.1/lib/rake/application.rb:160:in `invoke_task'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/rake-12.3.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/rake-12.3.1/lib/rake/application.rb:116:in `each'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/rake-12.3.1/lib/rake/application.rb:116:in `block in top_level'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/rake-12.3.1/lib/rake/application.rb:125:in `run_with_threads'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/rake-12.3.1/lib/rake/application.rb:110:in `top_level'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/rake-12.3.1/lib/rake/application.rb:83:in `block in run'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/rake-12.3.1/lib/rake/application.rb:80:in `run'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/capistrano-3.10.2/lib/capistrano/application.rb:14:in `run'
/Users/pRdm/.rvm/gems/ruby-2.4.1/gems/capistrano-3.10.2/bin/cap:3:in `<top (required)>'
/Users/pRdm/.rvm/gems/ruby-2.4.1/bin/cap:23:in `load'
/Users/pRdm/.rvm/gems/ruby-2.4.1/bin/cap:23:in `<main>'
/Users/pRdm/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `eval'
/Users/pRdm/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `<main>'

Digging into it a little bit seems to reveal that this line from CapEC2::Utils produced the error:

config = YAML.load(ERB.new(File.read(fetch(:ec2_config))))

This fixes the issue for me:

config = YAML.load(ERB.new(File.read(fetch(:ec2_config))).result)

I think this is coming from YAML.load trying to call #to_s on the ERB instance. Possibly an update within YAML broke this code?

@comp615
Copy link

comp615 commented May 23, 2018

Also seeing this error

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants