dimanche 12 décembre 2021

Ruby on Rails 2.3 LTS upgrade issue - undefined method `search' for ["http://rubygems.org/"]:Array (NoMethodError)

I am upgrading Rails 2.3 LTS Free Community Edition of Makandra Rails 2.3 Long Term Support to Rails 6. With a lot of difficulty I was able to bundle install gems required. But I am not able to boot up to rails console. Without it running I won't be able to use the rails:update / upgrade scripts to upgrade...

Bundler version 1.17.3

Here is the error stack:

[adminuser@localhost usabmx]$ bundle exec script/console
Loading development environment (Rails 2.3.18)
/home/adminuser/Documents/freelance_projects/bmx_repo/usabmx/config/environment.rb:26: warning: already initialized constant Gem::SourceIndex
/home/adminuser/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.17.3/lib/bundler/rubygems_integration.rb:417: warning: previous definition of SourceIndex was here
/home/adminuser/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/rails-c2be41e8dba7/railties/lib/rails/gem_dependency.rb:104:in `specification': undefined method `search' for ["http://rubygems.org/"]:Array (NoMethodError)
    from /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/rails-c2be41e8dba7/railties/lib/rails/plugin/locator.rb:81:in `block in plugins'
    from /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/rails-c2be41e8dba7/railties/lib/rails/plugin/locator.rb:81:in `each'
    from /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/rails-c2be41e8dba7/railties/lib/rails/plugin/locator.rb:81:in `inject'
    from /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/rails-c2be41e8dba7/railties/lib/rails/plugin/locator.rb:81:in `plugins'
    from /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/rails-c2be41e8dba7/railties/lib/rails/plugin/loader.rb:109:in `block in locate_plugins'
    from /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/rails-c2be41e8dba7/railties/lib/rails/plugin/loader.rb:108:in `map'
    from /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/rails-c2be41e8dba7/railties/lib/rails/plugin/loader.rb:108:in `locate_plugins'
    from /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/rails-c2be41e8dba7/railties/lib/rails/plugin/loader.rb:32:in `all_plugins'
    from /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/rails-c2be41e8dba7/railties/lib/rails/plugin/loader.rb:22:in `plugins'
    from /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/rails-c2be41e8dba7/railties/lib/rails/plugin/loader.rb:53:in `add_plugin_load_paths'
    from /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/rails-c2be41e8dba7/railties/lib/initializer.rb:310:in `add_plugin_load_paths'
    from /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/rails-c2be41e8dba7/railties/lib/initializer.rb:139:in `process'
    from /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/rails-c2be41e8dba7/railties/lib/initializer.rb:113:in `run'
    from /home/adminuser/Documents/freelance_projects/bmx_repo/usabmx/config/environment.rb:40:in `<top (required)>'
    from /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/2.1.0/irb/init.rb:286:in `require'
    from /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/2.1.0/irb/init.rb:286:in `block in load_modules'
    from /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/2.1.0/irb/init.rb:284:in `each'
    from /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/2.1.0/irb/init.rb:284:in `load_modules'
    from /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/2.1.0/irb/init.rb:20:in `setup'
    from /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/2.1.0/irb.rb:380:in `start'
    from /home/adminuser/.rbenv/versions/2.1.5/bin/irb:11:in <main>

Here is the gem env output:

[adminuser@localhost usabmx]$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.30
  - RUBY VERSION: 2.1.5 (2014-11-13 patchlevel 273) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0
  - RUBY EXECUTABLE: /home/adminuser/.rbenv/versions/2.1.5/bin/ruby
  - EXECUTABLE DIRECTORY: /home/adminuser/.rbenv/versions/2.1.5/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/adminuser/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0
     - /home/adminuser/.gem/ruby/2.1.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-rdoc --no-ri"
  - REMOTE SOURCES:
     - http://rubygems.org/

Here is the Gemfile:

source "https://rubygems.org"

gem 'countries'
gem 'nokogiri'
gem 'iconv'

# This is Rails 2.3 LTS - http://makandracards.com/railslts/16137-installing-rails-lts
gem 'rails', :git => 'https://github.com/makandra/rails.git', :branch => '2-3-lts'
gem 'rack'
#gem 'rdoc'
gem 'rake'

gem 'pg'
gem 'stripe'

# Quickbooks/Authnet export gems
gem 'authorizenet' # This is for transaction batch API
# In the future, need to switch back to the standard repository if they accept
# our pull request for Rails 2.3
gem 'riif', :git => "https://github.com/newmedio/riif.git"

# This is for the Satori Address Validation API
# gem 'savon', '~> 2.0'
# gem 'savon', github: 'savonrb/savon' # This fails when running bundle install

gem 'spreadsheet'

gem 'will_paginate', '= 2.3.16'

gem 'byebug'

gem 'aws-s3'
gem 'ruby-aaws'
gem 'mini_magick', '= 1.2.3'
gem 'rvideo'

gem 'geokit', '= 1.13.0'
gem 'prawn', '= 1.0.0.rc1'
gem 'combine_pdf'
gem 'zip-codes'

gem 'barby'
gem 'chunky_png'
gem 'httparty'
gem 'json'
gem 'json_cve_2020_10663'
gem 'twitter'
gem 'icalendar'

gem 'ruby-debug-ide', :group => "development"
gem 'debase', :group => "development"
gem 'capistrano', '= 3.3.3', :group => "development"
gem 'capistrano-bundler', :group => "development"
gem 'capistrano-passenger', :group => "development"
gem 'capistrano-rails', :group => "development"
gem 'capistrano-rvm', :group => "development"

gem 'linode'

gem 'recaptcha', '= 0.4.0', :require => "recaptcha/rails"
gem 'honeypot-captcha'

Aucun commentaire:

Enregistrer un commentaire