Closed mickael-palma-argus closed 7 years ago
Can you run your app with GLI_DEBUG=true
so that it generates a stack trace and we can see where that error is coming from?
GLI_DEBUG=true my_app whatever -foo=bar # for example
imac:etl4api mickael$ GLI_DEBUG=true bundle exec bin/etl4api initconfig
error: can't modify frozen String
bundler: failed to load command: bin/etl4api (bin/etl4api)
RuntimeError: can't modify frozen String
/Users/mickael/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gli-2.16.0/lib/gli/commands/initconfig.rb:41:in `force_encoding'
/Users/mickael/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gli-2.16.0/lib/gli/commands/initconfig.rb:41:in `block in create_config'
/Users/mickael/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gli-2.16.0/lib/gli/commands/initconfig.rb:38:in `map'
/Users/mickael/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gli-2.16.0/lib/gli/commands/initconfig.rb:38:in `create_config'
/Users/mickael/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gli-2.16.0/lib/gli/commands/initconfig.rb:27:in `block in initialize'
/Users/mickael/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gli-2.16.0/lib/gli/command_support.rb:131:in `execute'
/Users/mickael/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gli-2.16.0/lib/gli/app_support.rb:296:in `block in call_command'
/Users/mickael/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gli-2.16.0/lib/gli/app_support.rb:309:in `call_command'
/Users/mickael/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gli-2.16.0/lib/gli/app_support.rb:83:in `run'
bin/etl4api:176:in `<top (required)>'
If you wonder line 176 has : exit run(ARGV)
It's this line: https://github.com/davetron5000/gli/blob/gli-2/lib/gli/commands/initconfig.rb#L41
That line might not be needed any longer—I think it was added for support of an old Ruby. If you want to try removing it and making a PR we can see if the current build matrix passes it.
Hi,
I have
# frozen_string_literal: true
at the beginning of my bin file. When I runbundle exec bin/app initconfig
I get this error:I have to use
# frozen_string_literal: false
to succeed the command.How I can I make it work with
# frozen_string_literal: true
.Thx for your help.