Ошибка инициализации консоли Rails после обновления Bundler до 2.1.4 - PullRequest
0 голосов
/ 06 августа 2020

Это происходит ТОЛЬКО на машине Elasti c Beanstalk, у меня нет проблем с локальной инициализацией консоли rails.

Мы только что обновились до Bundler 2.1.4 с 1.17.3

Скрипт, используемый для запуска консоли rails на нашей машине EB:

#!/usr/bin/env bash
#
# Rails console script that can be run on AWS Elastic Beanstalk.

set -xe

EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir)
EB_APP_DEPLOY_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_deploy_dir)
EB_APP_USER=$(/opt/elasticbeanstalk/bin/get-config container -k app_user)
EB_SUPPORT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k support_dir)
EB_PID_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_pid_dir)
EB_LOG_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_log_dir)

. $EB_SUPPORT_DIR/envvars

. $EB_SCRIPT_DIR/use-app-ruby.sh

cd $EB_APP_DEPLOY_DIR

su -s /bin/bash -c "bundle exec rails c" $EB_APP_USER

и это результат выполнения указанного скрипта:

Bundler will use `/tmp/bundler20200806-29516-1noiblx29516' as your home directory temporarily.
/opt/rubies/ruby-2.4.3/lib/ruby/2.4.0/uri/ftp.rb:23:in `<module:URI>': /opt/rubies/ruby-2.4.3/lib/ruby/2.4.0/uri.rb:99: warning: already initialized constant URI::VERSION_CODE
/opt/rubies/ruby-2.4.3/lib/ruby/2.4.0/uri.rb:99: warning: previous definition of VERSION_CODE was here
/opt/rubies/ruby-2.4.3/lib/ruby/2.4.0/uri.rb:100: warning: already initialized constant URI::VERSION
/opt/rubies/ruby-2.4.3/lib/ruby/2.4.0/uri.rb:100: warning: previous definition of VERSION was here
uninitialized constant URI::Generic (NameError)
Did you mean?  URI::Generic
    from /opt/rubies/ruby-2.4.3/lib/ruby/2.4.0/uri/ftp.rb:13:in `<top (required)>'
    from /opt/rubies/ruby-2.4.3/lib/ruby/2.4.0/uri.rb:107:in `require'
    from /opt/rubies/ruby-2.4.3/lib/ruby/2.4.0/uri.rb:107:in `<top (required)>'
    from /opt/rubies/ruby-2.4.3/lib/ruby/2.4.0/uri/rfc2396_parser.rb:13:in `require'
    from /opt/rubies/ruby-2.4.3/lib/ruby/2.4.0/uri/rfc2396_parser.rb:13:in `<top (required)>'
    from /opt/rubies/ruby-2.4.3/lib/ruby/2.4.0/uri/common.rb:13:in `require'
    from /opt/rubies/ruby-2.4.3/lib/ruby/2.4.0/uri/common.rb:13:in `<top (required)>'
    from /opt/rubies/ruby-2.4.3/lib/ruby/2.4.0/uri/generic.rb:12:in `require'
    from /opt/rubies/ruby-2.4.3/lib/ruby/2.4.0/uri/generic.rb:12:in `<top (required)>'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/activesupport-5.2.3/lib/active_support/core_ext/object/json.rb:6:in `require'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/activesupport-5.2.3/lib/active_support/core_ext/object/json.rb:6:in `<top (required)>'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/activesupport-5.2.3/lib/active_support/core_ext/object.rb:13:in `require'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/activesupport-5.2.3/lib/active_support/core_ext/object.rb:13:in `<top (required)>'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/railties-5.2.3/lib/rails/configuration.rb:4:in `require'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/railties-5.2.3/lib/rails/configuration.rb:4:in `<top (required)>'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/railties-5.2.3/lib/rails/railtie/configuration.rb:3:in `require'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/railties-5.2.3/lib/rails/railtie/configuration.rb:3:in `<top (required)>'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/railties-5.2.3/lib/rails/railtie.rb:223:in `require'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/railties-5.2.3/lib/rails/railtie.rb:223:in `config'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/railties-5.2.3/lib/rails/railtie.rb:127:in `config'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/activesupport-5.2.3/lib/active_support/i18n_railtie.rb:11:in `<class:Railtie>'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/activesupport-5.2.3/lib/active_support/i18n_railtie.rb:10:in `<module:I18n>'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/activesupport-5.2.3/lib/active_support/i18n_railtie.rb:9:in `<top (required)>'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/activesupport-5.2.3/lib/active_support/railtie.rb:4:in `require'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/activesupport-5.2.3/lib/active_support/railtie.rb:4:in `<top (required)>'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/railties-5.2.3/lib/rails.rb:17:in `require'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/railties-5.2.3/lib/rails.rb:17:in `<top (required)>'
    from /var/app/current/config/application.rb:3:in `require'
    from /var/app/current/config/application.rb:3:in `<top (required)>'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/railties-5.2.3/lib/rails/command/actions.rb:22:in `require'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/railties-5.2.3/lib/rails/command/actions.rb:22:in `require_application!'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/railties-5.2.3/lib/rails/command/actions.rb:14:in `require_application_and_environment!'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/railties-5.2.3/lib/rails/commands/console/console_command.rb:95:in `perform'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/railties-5.2.3/lib/rails/command/base.rb:65:in `perform'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/railties-5.2.3/lib/rails/command.rb:46:in `invoke'
    from /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>'
    from bin/rails:9:in `require'
    from bin/rails:9:in `<main>'

Неудачная попытка выполнения bundle clean --force и добавления require 'uri' к application.rb

Любая подсказка приветствуется! Спасибо.

1 Ответ

0 голосов
/ 10 августа 2020

Мы не смогли найти обходного пути, поэтому в итоге мы понизили версию до 1.17.4!

...