Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load rails console rails-5.1.4 ruby-2.3.1 #45

Closed
flah00 opened this issue Dec 21, 2017 · 1 comment
Closed

Unable to load rails console rails-5.1.4 ruby-2.3.1 #45

flah00 opened this issue Dec 21, 2017 · 1 comment
Labels

Comments

@flah00
Copy link

flah00 commented Dec 21, 2017

When using ougai as my logger and initializing honeybadger, I'm unable to start a rails console, on a fresh rails-5.1.4 install, with ruby-2.3.1.

  1. rails new rtest -d postgresql
  2. cd rtest
  3. copy files into place
  4. bundle install
  5. bundle exec rails s
    • should succeed
  6. bundle exec rails c
    • should fail
  7. Comment out logger line, in application.rb
  8. bundle exec rails c
    • should succeed

Stacktrace of failure

/app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/ougai-1.5.7/lib/ougai/formatters/readable.rb:22:in `delete': no implicit conversion of Symbol into String (TypeError)
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/ougai-1.5.7/lib/ougai/formatters/readable.rb:22:in `call'
        from /app/.rbenv/versions/2.3.1/lib/ruby/2.3.0/logger.rb:546:in `format_message'
        from /app/.rbenv/versions/2.3.1/lib/ruby/2.3.0/logger.rb:434:in `add'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/honeybadger-3.2.0/lib/honeybadger/logging.rb:100:in `add'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/honeybadger-3.2.0/lib/honeybadger/logging.rb:134:in `add'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/honeybadger-3.2.0/lib/honeybadger/logging.rb:49:in `block (2 levels) in <class:Base>'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/honeybadger-3.2.0/lib/honeybadger/config.rb:58:in `init!'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/honeybadger-3.2.0/lib/honeybadger/init/rails.rb:21:in `block in <class:Railtie>'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:67:in `block in execute_hook'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:60:in `with_execution_control'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:65:in `execute_hook'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:50:in `block in run_load_hooks'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:49:in `each'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:49:in `run_load_hooks'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/finisher.rb:73:in `block in <module:Finisher>'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `instance_exec'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `run'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:59:in `block in run_initializers'
        from /app/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
        from /app/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from /app/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from /app/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from /app/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each'
        from /app/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `call'
        from /app/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
        from /app/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
        from /app/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:58:in `run_initializers'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:353:in `initialize!'
        from /app/devel/rtest2/config/environment.rb:5:in `<top (required)>'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/application.rb:102:in `preload'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
        from /app/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
        from /app/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /app/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from -e:1:in `<main>'

Gemfile

source 'https://rubygems.org'


gem 'rails', '~> 5.1.4'
gem 'pg', '~> 0.20'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2.2'

gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'honeybadger'
gem 'ougai'
gem 'awesome_print'
gem 'google-api-client', require: 'google/apis/sheets_v4'
gem 'restforce'
gem 'omniauth-salesforce'
gem 'salesforce_bulk_api'

gem 'puma'
gem 'redis-session-store'

group :development, :test do
  gem 'byebug'
  gem 'rspec-rails'
  gem 'faker'
  gem 'activerecord-nulldb-adapter'
end

group :development do
  gem 'web-console'
  gem 'listen', '>= 3.0.5', '< 3.2'

  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

config/application.rb

require_relative 'boot'

require 'rails/all'
require_relative '../lib/ld_api/logger'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module Rtest2
  class Application < Rails::Application
    # Initialize configuration defaults for originally generated Rails version.
    config.load_defaults 5.1

    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.
    config.autoload_paths << Rails.root.join('lib')
    config.colorize_logging = false
    config.logger = LdApi::Logger.new(STDOUT)
  end
end

lib/ld_api/logger.rb

require 'ougai'

module LdApi
  class Logger < Ougai::Logger
    include ActiveSupport::LoggerThreadSafeLevel
    include LoggerSilence

    def initialize(*args)
      super
      after_initialize if respond_to? :after_initialize
    end

    def create_formatter
      if Rails.env.development? || Rails.env.test?
        Ougai::Formatters::Readable.new
      else
        Ougai::Formatters::Bunyan.new
      end
    end
  end
end

config/honeybadger.yml

---
api_key: somekey
@tilfin
Copy link
Owner

tilfin commented Dec 21, 2017

Thank you for the bug report.
I released v1.5.8 fixed. please use it!

[2017-12-21T15:41:00.064+09:00] INFO: ** [Honeybadger] Initializing Honeybadger Error Tracker for Ruby. Ship it! version=3.2.0 framework=rails level=1 pid=50535
[2017-12-21T15:41:00.065+09:00] WARN: ** [Honeybadger] Development mode is enabled. Data will not be reported until you deploy your app. level=2 pid=50535
Running via Spring preloader in process 50541
Loading development environment (Rails 5.1.4)
irb(main):001:0> 

@tilfin tilfin added the bug label Dec 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants