ruby-gettext / gettext

Gettext gem is a pure Ruby Localization(L10n) library and tool which is modeled after the GNU gettext package.
https://ruby-gettext.github.io/
69 stars 28 forks source link

"'ErbParser' is ignored." at Arch Linux #64

Closed anatol closed 4 years ago

anatol commented 4 years ago

I am running gitlab at Arch Linux with ruby 2.6 installed and see following warning:

'ErbParser' is ignored.
'RubyParser' is ignored.

Debugging it a little bit more I found that it came from bundled gettext. I added more debug entries to the source code and found that it cannot find class RubyToken:

uninitialized constant GetText::RubyLexX::RubyToken
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext-3.2.9/lib/gettext/tools/parser/ruby.rb:120:in `<class:RubyLexX>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext-3.2.9/lib/gettext/tools/parser/ruby.rb:22:in `<module:GetText>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext-3.2.9/lib/gettext/tools/parser/ruby.rb:21:in `<top (required)>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext-3.2.9/lib/gettext/tools/parser/erb.rb:13:in `<top (required)>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:62:in `block in <class:XGetText>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:60:in `each'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:60:in `<class:XGetText>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:31:in `<module:Tools>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:30:in `<module:GetText>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:29:in `<top (required)>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext_i18n_rails_js-1.3.0/lib/gettext_i18n_rails_js/parser/base.rb:26:in `<top (required)>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext_i18n_rails_js-1.3.0/lib/gettext_i18n_rails_js/parser.rb:26:in `require_relative'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext_i18n_rails_js-1.3.0/lib/gettext_i18n_rails_js/parser.rb:26:in `<top (required)>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext_i18n_rails_js-1.3.0/lib/gettext_i18n_rails_js.rb:37:in `require_relative'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext_i18n_rails_js-1.3.0/lib/gettext_i18n_rails_js.rb:37:in `<top (required)>'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/runtime.rb:74:in `require'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/runtime.rb:74:in `block (2 levels) in require'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/runtime.rb:69:in `each'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/runtime.rb:69:in `block in require'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/runtime.rb:58:in `each'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/runtime.rb:58:in `require'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler.rb:174:in `require'
/usr/share/webapps/gitlab/config/application.rb:11:in `<top (required)>'
/usr/share/webapps/gitlab/Rakefile:5:in `require'
/usr/share/webapps/gitlab/Rakefile:5:in `<top (required)>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/lib/rake/rake_module.rb:29:in `load'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/lib/rake/rake_module.rb:29:in `load_rakefile'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:703:in `raw_load_rakefile'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:104:in `block in load_rakefile'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:103:in `load_rakefile'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:82:in `block in run'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:80:in `run'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/bin/rake:23:in `load'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/bin/rake:23:in `<top (required)>'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/cli/exec.rb:63:in `load'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/cli/exec.rb:63:in `kernel_load'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/cli/exec.rb:28:in `run'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/cli.rb:476:in `exec'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/cli.rb:30:in `dispatch'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/cli.rb:24:in `start'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/exe/bundle:46:in `block in <top (required)>'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/friendly_errors.rb:123:in `with_friendly_errors'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/exe/bundle:34:in `<top (required)>'
/usr/bin/bundle:23:in `load'
/usr/bin/bundle:23:in `<main>'
'ErbParser' is ignored.
uninitialized constant GetText::RubyLexX::RubyToken
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext-3.2.9/lib/gettext/tools/parser/ruby.rb:120:in `<class:RubyLexX>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext-3.2.9/lib/gettext/tools/parser/ruby.rb:22:in `<module:GetText>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext-3.2.9/lib/gettext/tools/parser/ruby.rb:21:in `<top (required)>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:62:in `block in <class:XGetText>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:60:in `each'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:60:in `<class:XGetText>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:31:in `<module:Tools>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:30:in `<module:GetText>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:29:in `<top (required)>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext_i18n_rails_js-1.3.0/lib/gettext_i18n_rails_js/parser/base.rb:26:in `<top (required)>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext_i18n_rails_js-1.3.0/lib/gettext_i18n_rails_js/parser.rb:26:in `require_relative'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext_i18n_rails_js-1.3.0/lib/gettext_i18n_rails_js/parser.rb:26:in `<top (required)>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext_i18n_rails_js-1.3.0/lib/gettext_i18n_rails_js.rb:37:in `require_relative'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/gettext_i18n_rails_js-1.3.0/lib/gettext_i18n_rails_js.rb:37:in `<top (required)>'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/runtime.rb:74:in `require'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/runtime.rb:74:in `block (2 levels) in require'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/runtime.rb:69:in `each'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/runtime.rb:69:in `block in require'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/runtime.rb:58:in `each'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/runtime.rb:58:in `require'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler.rb:174:in `require'
/usr/share/webapps/gitlab/config/application.rb:11:in `<top (required)>'
/usr/share/webapps/gitlab/Rakefile:5:in `require'
/usr/share/webapps/gitlab/Rakefile:5:in `<top (required)>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/lib/rake/rake_module.rb:29:in `load'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/lib/rake/rake_module.rb:29:in `load_rakefile'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:703:in `raw_load_rakefile'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:104:in `block in load_rakefile'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:103:in `load_rakefile'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:82:in `block in run'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:80:in `run'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/bin/rake:23:in `load'
/usr/share/webapps/gitlab/vendor/bundle/ruby/2.6.0/bin/rake:23:in `<top (required)>'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/cli/exec.rb:63:in `load'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/cli/exec.rb:63:in `kernel_load'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/cli/exec.rb:28:in `run'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/cli.rb:476:in `exec'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/cli.rb:30:in `dispatch'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/cli.rb:24:in `start'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/exe/bundle:46:in `block in <top (required)>'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/lib/bundler/friendly_errors.rb:123:in `with_friendly_errors'
/usr/lib/ruby/gems/2.6.0/gems/bundler-2.1.2/exe/bundle:34:in `<top (required)>'
/usr/bin/bundle:23:in `load'
/usr/bin/bundle:23:in `<main>'
'RubyParser' is ignored.

Could you please help me to understand where class RubyToken suppose to come from?

kou commented 4 years ago

It depends on IRB's parser but IRB's parser is rewritten in the recent IRB. So we need to rewrite our parser.

anatol commented 4 years ago

Yeah, Arch uses the latest version of IRB. And btw IRB been decoupled from ruby core recently and moved to a separate project.

nurse commented 4 years ago

irb uses/has a parser which interprets Ruby syntax, and it has RubyToken module. But Ruby 2.7 rewrite irb to use another parser (ripper) and it (and irb 1.2.0) removes the module

anatol commented 4 years ago

Thank you very much for this information.

It sounds like ruby-gettext gem should add a versioned gem dependency to irb s.add_runtime_dependency("irb", "~> 1.1.0")

kou commented 4 years ago

I've implemented and released 3.3.0.

anatol commented 4 years ago

Thank you a lot! Does it mean that gettext does not depend on 'irb' gem anymore?

kou commented 4 years ago

Yes.