thought-driven / bummr

Update your gems in separate commits. Identify any that fail your build.
MIT License
234 stars 23 forks source link

uninitialized constant Bummr::Updater::Error (NameError) #61

Closed ruanltbg closed 4 months ago

ruanltbg commented 4 years ago

When trying to update my gemfile I get this error.

.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bummr-0.5.0/lib/bummr/updater.rb:48:in rescue in updated_version_for': uninitialized constant Bummr::Updater::Error (NameError)`

The exception happens on https://github.com/lpender/bummr/blob/master/lib/bummr/updater.rb#L45 where the Error is called but was never defined.

Gemfile:

# frozen_string_literal: true

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '~> 2.5.1'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', ['~> 5.2.1', '!=5.2.1.1']
# Use sqlite3 as the database for Active Record

gem 'pg'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
# gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false

# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
# gem 'rack-cors'
#
gem 'aws-sdk-s3', require: false

gem 'fast_jsonapi'
gem 'health_check'
gem 'quandl-config'
gem 'redcarpet'
gem 'sentry-raven'

## Improve the admin panel

gem 'active_material'
gem 'activeadmin'
gem 'clearance'
gem 'mini_magick'
gem 'sass-rails'

group :debug do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: %i[mri mingw x64_mingw]
end

group :development do
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
end

group :test, :ci do
  gem 'factory_bot_rails'
  gem 'faker'
  gem 'rails-controller-testing'
  gem 'rspec-rails'
  gem 'shoulda-matchers', '4.0.0.rc1'
  gem 'simplecov', require: false
end

Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (5.2.3)
      actionpack (= 5.2.3)
      nio4r (~> 2.0)
      websocket-driver (>= 0.6.1)
    actionmailer (5.2.3)
      actionpack (= 5.2.3)
      actionview (= 5.2.3)
      activejob (= 5.2.3)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (5.2.3)
      actionview (= 5.2.3)
      activesupport (= 5.2.3)
      rack (~> 2.0)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (5.2.3)
      activesupport (= 5.2.3)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.3)
    active_material (1.4.2)
    activeadmin (1.4.3)
      arbre (>= 1.1.1)
      coffee-rails
      formtastic (~> 3.1)
      formtastic_i18n
      inherited_resources (>= 1.9.0)
      jquery-rails (>= 4.2.0)
      kaminari (>= 0.15)
      railties (>= 4.2, < 5.3)
      ransack (>= 1.8.7)
      sass (~> 3.1)
      sprockets (< 4.1)
    activejob (5.2.3)
      activesupport (= 5.2.3)
      globalid (>= 0.3.6)
    activemodel (5.2.3)
      activesupport (= 5.2.3)
    activerecord (5.2.3)
      activemodel (= 5.2.3)
      activesupport (= 5.2.3)
      arel (>= 9.0)
    activestorage (5.2.3)
      actionpack (= 5.2.3)
      activerecord (= 5.2.3)
      marcel (~> 0.3.1)
    activesupport (5.2.3)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 0.7, < 2)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
    arbre (1.1.1)
      activesupport (>= 3.0.0)
    arel (9.0.0)
    aws-eventstream (1.0.2)
    aws-partitions (1.148.0)
    aws-sdk-core (3.48.3)
      aws-eventstream (~> 1.0, >= 1.0.2)
      aws-partitions (~> 1.0)
      aws-sigv4 (~> 1.1)
      jmespath (~> 1.0)
    aws-sdk-kms (1.16.0)
      aws-sdk-core (~> 3, >= 3.48.2)
      aws-sigv4 (~> 1.1)
    aws-sdk-s3 (1.36.0)
      aws-sdk-core (~> 3, >= 3.48.2)
      aws-sdk-kms (~> 1)
      aws-sigv4 (~> 1.0)
    aws-sigv4 (1.1.0)
      aws-eventstream (~> 1.0, >= 1.0.2)
    bcrypt (3.1.12)
    bootsnap (1.4.2)
      msgpack (~> 1.0)
    builder (3.2.3)
    byebug (11.0.1)
    clearance (1.17.0)
      actionmailer (>= 3.1)
      activemodel (>= 3.1)
      activerecord (>= 3.1)
      bcrypt
      email_validator (~> 1.4)
      railties (>= 3.1)
    coffee-rails (4.2.2)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.12.2)
    concurrent-ruby (1.1.5)
    crass (1.0.4)
    diff-lcs (1.3)
    docile (1.3.1)
    email_validator (1.6.0)
      activemodel
    erubi (1.8.0)
    execjs (2.7.0)
    factory_bot (5.0.2)
      activesupport (>= 4.2.0)
    factory_bot_rails (5.0.1)
      factory_bot (~> 5.0.0)
      railties (>= 4.2.0)
    faker (1.9.3)
      i18n (>= 0.7)
    faraday (0.15.4)
      multipart-post (>= 1.2, < 3)
    fast_jsonapi (1.5)
      activesupport (>= 4.2)
    ffi (1.10.0)
    formtastic (3.1.5)
      actionpack (>= 3.2.13)
    formtastic_i18n (0.6.0)
    globalid (0.4.2)
      activesupport (>= 4.2.0)
    has_scope (0.7.2)
      actionpack (>= 4.1)
      activesupport (>= 4.1)
    health_check (3.0.0)
      railties (>= 5.0)
    i18n (1.6.0)
      concurrent-ruby (~> 1.0)
    inherited_resources (1.9.0)
      actionpack (>= 4.2, < 5.3)
      has_scope (~> 0.6)
      railties (>= 4.2, < 5.3)
      responders
    jmespath (1.4.0)
    jquery-rails (4.3.3)
      rails-dom-testing (>= 1, < 3)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    json (2.2.0)
    kaminari (1.1.1)
      activesupport (>= 4.1.0)
      kaminari-actionview (= 1.1.1)
      kaminari-activerecord (= 1.1.1)
      kaminari-core (= 1.1.1)
    kaminari-actionview (1.1.1)
      actionview
      kaminari-core (= 1.1.1)
    kaminari-activerecord (1.1.1)
      activerecord
      kaminari-core (= 1.1.1)
    kaminari-core (1.1.1)
    listen (3.1.5)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
      ruby_dep (~> 1.2)
    loofah (2.2.3)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    mail (2.7.1)
      mini_mime (>= 0.1.1)
    marcel (0.3.3)
      mimemagic (~> 0.3.2)
    method_source (0.9.2)
    mimemagic (0.3.3)
    mini_magick (4.9.2)
    mini_mime (1.0.1)
    mini_portile2 (2.4.0)
    minitest (5.11.3)
    msgpack (1.2.9)
    multipart-post (2.0.0)
    nio4r (2.3.1)
    nokogiri (1.10.3)
      mini_portile2 (~> 2.4.0)
    pg (1.1.4)
    puma (3.12.1)
    quandl-config (1.0.0)
      activesupport
    rack (2.0.7)
    rack-test (1.1.0)
      rack (>= 1.0, < 3)
    rails (5.2.3)
      actioncable (= 5.2.3)
      actionmailer (= 5.2.3)
      actionpack (= 5.2.3)
      actionview (= 5.2.3)
      activejob (= 5.2.3)
      activemodel (= 5.2.3)
      activerecord (= 5.2.3)
      activestorage (= 5.2.3)
      activesupport (= 5.2.3)
      bundler (>= 1.3.0)
      railties (= 5.2.3)
      sprockets-rails (>= 2.0.0)
    rails-controller-testing (1.0.4)
      actionpack (>= 5.0.1.x)
      actionview (>= 5.0.1.x)
      activesupport (>= 5.0.1.x)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.0.4)
      loofah (~> 2.2, >= 2.2.2)
    railties (5.2.3)
      actionpack (= 5.2.3)
      activesupport (= 5.2.3)
      method_source
      rake (>= 0.8.7)
      thor (>= 0.19.0, < 2.0)
    rake (12.3.2)
    ransack (2.1.1)
      actionpack (>= 5.0)
      activerecord (>= 5.0)
      activesupport (>= 5.0)
      i18n
    rb-fsevent (0.10.3)
    rb-inotify (0.10.0)
      ffi (~> 1.0)
    redcarpet (3.4.0)
    responders (2.4.1)
      actionpack (>= 4.2.0, < 6.0)
      railties (>= 4.2.0, < 6.0)
    rspec-core (3.8.1)
      rspec-support (~> 3.8.0)
    rspec-expectations (3.8.4)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.8.0)
    rspec-mocks (3.8.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.8.0)
    rspec-rails (3.8.2)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      railties (>= 3.0)
      rspec-core (~> 3.8.0)
      rspec-expectations (~> 3.8.0)
      rspec-mocks (~> 3.8.0)
      rspec-support (~> 3.8.0)
    rspec-support (3.8.2)
    ruby_dep (1.5.0)
    sass (3.7.3)
      sass-listen (~> 4.0.0)
    sass-listen (4.0.0)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
    sass-rails (5.0.7)
      railties (>= 4.0.0, < 6)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (>= 1.1, < 3)
    sentry-raven (2.9.0)
      faraday (>= 0.7.6, < 1.0)
    shoulda-matchers (4.0.0.rc1)
      activesupport (>= 4.2.0)
    simplecov (0.16.1)
      docile (~> 1.1)
      json (>= 1.8, < 3)
      simplecov-html (~> 0.10.0)
    simplecov-html (0.10.2)
    sprockets (3.7.2)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.2.1)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    thor (0.20.3)
    thread_safe (0.3.6)
    tilt (2.0.9)
    tzinfo (1.2.5)
      thread_safe (~> 0.1)
    websocket-driver (0.7.0)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.3)

PLATFORMS
  ruby

DEPENDENCIES
  active_material
  activeadmin
  aws-sdk-s3
  bootsnap (>= 1.1.0)
  byebug
  clearance
  factory_bot_rails
  faker
  fast_jsonapi
  health_check
  listen (>= 3.0.5, < 3.2)
  mini_magick
  pg
  puma (~> 3.11)
  quandl-config
  rails (~> 5.2.1, != 5.2.1.1)
  rails-controller-testing
  redcarpet
  rspec-rails
  sass-rails
  sentry-raven
  shoulda-matchers (= 4.0.0.rc1)
  simplecov

RUBY VERSION
   ruby 2.5.1p57

BUNDLED WITH
   2.0.2

The problem happens because one of the gem activeadmin v 1.4.3 was requiring coffee-script v4.2.2 but the new activeadmin v2.3.1 does not require this gem anymore and bummr is still trying to update it.

lpender commented 4 years ago

Thanks for the error report. PRs welcome

lpender commented 4 years ago

It may be useful when running bummr update --all to first run bummr update

matthewhively commented 1 year ago

I also encountered this exception.

.rvm/gems/ruby-2.5.7/gems/bummr-0.6.0/lib/bummr/updater.rb:48:in `rescue in updated_version_for': uninitialized constant Bummr::Updater::Error (NameError)
Did you mean?  IOError
               Errno

I had previously run bummr update before bummr update --all

matthewhively commented 1 year ago

Maybe the line https://github.com/thought-driven/bummr/blob/master/lib/bummr/updater.rb#L45 Should actually be rescue StandardError ? Or just rescue?