gitlabhq-11.3.1.ebuild: Error in "Compile GetText PO files ..." phase
When running emerge --config "=www-apps/gitlabhq-11.3.1"
in the "Compile GetText PO files ..." phase I got the error
module.js:550
throw err;
^
Error: Cannot find module 'gettext-extractor'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/opt/gitlabhq-11.3/scripts/frontend/extract_gettext_all.js:3:44)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
Error parsing app/assets/javascripts/shortcuts_issuable.js
rake aborted!
JSON::ParserError: A JSON text must at least contain two octets!
/opt/gitlabhq-11.3/vendor/bundle/ruby/2.4.0/gems/json-1.8.6/lib/json/common.rb:155:in `initialize'
/opt/gitlabhq-11.3/vendor/bundle/ruby/2.4.0/gems/json-1.8.6/lib/json/common.rb:155:in `new'
/opt/gitlabhq-11.3/vendor/bundle/ruby/2.4.0/gems/json-1.8.6/lib/json/common.rb:155:in `parse'
/opt/gitlabhq-11.3/config/initializers/gettext_rails_i18n_patch.rb:48:in `gettext_messages_by_file'
/opt/gitlabhq-11.3/config/initializers/gettext_rails_i18n_patch.rb:42:in `collect_for'
/opt/gitlabhq-11.3/vendor/bundle/ruby/2.4.0/gems/gettext_i18n_rails_js-1.3.0/lib/gettext_i18n_rails_js/parser/base.rb:74:in `parse'
/opt/gitlabhq-11.3/vendor/bundle/ruby/2.4.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:365:in `block in parse_path'
/opt/gitlabhq-11.3/vendor/bundle/ruby/2.4.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:360:in `each'
/opt/gitlabhq-11.3/vendor/bundle/ruby/2.4.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:360:in `parse_path'
/opt/gitlabhq-11.3/vendor/bundle/ruby/2.4.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:168:in `block in parse'
/opt/gitlabhq-11.3/vendor/bundle/ruby/2.4.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:166:in `each'
/opt/gitlabhq-11.3/vendor/bundle/ruby/2.4.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:166:in `parse'
/opt/gitlabhq-11.3/vendor/bundle/ruby/2.4.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:217:in `generate_pot'
/opt/gitlabhq-11.3/vendor/bundle/ruby/2.4.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:151:in `run'
/opt/gitlabhq-11.3/vendor/bundle/ruby/2.4.0/gems/gettext-3.2.9/lib/gettext/tools/xgettext.rb:34:in `run'
/opt/gitlabhq-11.3/vendor/bundle/ruby/2.4.0/gems/gettext-3.2.9/lib/gettext/tools/task.rb:330:in `xgettext'
/opt/gitlabhq-11.3/vendor/bundle/ruby/2.4.0/gems/gettext-3.2.9/lib/gettext/tools/task.rb:314:in `create_pot'
/opt/gitlabhq-11.3/vendor/bundle/ruby/2.4.0/gems/gettext-3.2.9/lib/gettext/tools/task.rb:306:in `block in define_pot_file_task'
/opt/gitlabhq-11.3/vendor/bundle/ruby/2.4.0/gems/gettext_i18n_rails-1.8.0/lib/gettext_i18n_rails/tasks.rb:60:in `block (2 levels) in <top (required)>'
/opt/gitlabhq-11.3/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => gettext:mo:update => gettext:mo:ar_SA:update => /opt/gitlabhq-11.3/locale/ar_SA/LC_MESSAGES/gitlab.mo => /opt/gitlabhq-11.3/locale/ar_SA/gitlab.po => /opt/gitlabhq-11.3/locale/ar_SA/gitlab.edit.po => /opt/gitlabhq-11.3/locale/gitlab.pot
(See full trace by running task with --trace)
The emerge itself does not fail because the command ${BUNDLE} exec rake gettext:pack RAILS_ENV=${RAILS_ENV}
in the ebuild has no || die ...
part.
I then tried the following:
root@<myhost> $ su -l git -s /bin/sh
git@<myhost> $ export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
git@<myhost> $ cd /opt/gitlabhq-11.3/
git@<myhost> $ RAILS_ENV=${RAILS_ENV:-production}
git@<myhost> $ npm install gettext-extractor
git@<myhost> $ ruby24 /usr/bin/bundle exec rake gettext:pack RAILS_ENV=${RAILS_ENV}
module.js:550
throw err;
^
Error: Cannot find module 'gettext-extractor-vue'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/opt/gitlabhq-11.3/scripts/frontend/extract_gettext_all.js:7:5)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
Error parsing app/assets/javascripts/shortcuts_issuable.js
rake aborted!
JSON::ParserError: A JSON text must at least contain two octets!
... (additional lines skipped)
git@<myhost> $ npm install gettext-extractor-vue
git@<myhost> $ ruby24 /usr/bin/bundle exec rake gettext:pack RAILS_ENV=${RAILS_ENV}
... (this one runs successfully with its normal messages)