hene

hene.dev

gem のアップデート

gem のアップデート

はじめて、gem 単体をアップデートした。

airbrake のアップデート

# Gemfile

- gem 'airbrake', '~> 8.0'
+ gem 'airbrake', '~> 8.2'

Gemfile を変更して bundle install

$ bundle install

サーバーを起動する。

問題なければとくに何もしなくて良いはずです。

$ bundle exec rails s
=> Booting Puma
=> Rails 5.2.1 application starting in development
=> Run `rails server -h` for more startup options
Exiting
Traceback (most recent call last):
	59: from bin/rails:4:in `<main>'
	58: from bin/rails:4:in `require'
	57: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/commands.rb:18:in `<top (required)>'
	56: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/command.rb:46:in `invoke'
	55: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/command/base.rb:65:in `perform'
	54: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
	53: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
	52: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
	51: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:142:in `perform'
	50: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:142:in `tap'
	49: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:147:in `block in perform'
	48: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:51:in `start'
	47: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:89:in `log_to_stdout'
	46: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/server.rb:354:in `wrapped_app'
	45: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:27:in `app'
	44: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/server.rb:219:in `app'
	43: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/server.rb:319:in `build_app_and_options_from_config'
	42: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:40:in `parse_file'
	41: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:49:in `new_from_string'
	40: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:49:in `eval'
	39: from config.ru:in `<main>'
	38: from config.ru:in `new'
	37: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:55:in `initialize'
	36: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:55:in `instance_eval'
	35: from config.ru:4:in `block in <main>'
	34: from config.ru:4:in `require_relative'
	33: from /Users/username/project_name/project_name_xxxxxx/config/environment.rb:5:in `<top (required)>'
	32: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/application.rb:361:in `initialize!'
	31: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:60:in `run_initializers'
	30: from /Users/username/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:205:in `tsort_each'
	29: from /Users/username/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:226:in `tsort_each'
	28: from /Users/username/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:347:in `each_strongly_connected_component'
	27: from /Users/username/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:347:in `call'
	26: from /Users/username/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:347:in `each'
	25: from /Users/username/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:349:in `block in each_strongly_connected_component'
	24: from /Users/username/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:415:in `each_strongly_connected_component_from'
	23: from /Users/username/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:415:in `call'
	22: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:50:in `tsort_each_child'
	21: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:50:in `each'
	20: from /Users/username/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
	19: from /Users/username/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:431:in `each_strongly_connected_component_from'
	18: from /Users/username/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
	17: from /Users/username/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	16: from /Users/username/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:228:in `block in tsort_each'
	15: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:61:in `block in run_initializers'
	14: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:32:in `run'
	13: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:32:in `instance_exec'
	12: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:613:in `block in <class:Engine>'
	11: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:613:in `each'
	10: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:614:in `block (2 levels) in <class:Engine>'
	 9: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:656:in `load_config_initializer'
	 8: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/notifications.rb:170:in `instrument'
	 7: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:657:in `block in load_config_initializer'
	 6: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:281:in `load'
	 5: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
	 4: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:281:in `block in load'
	 3: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:281:in `load'
	 2: from /Users/username/project_name/project_name_xxxxxx/config/initializers/airbrake.rb:3:in `<top (required)>'
	 1: from /Users/username/project_name/project_name_xxxxxx/vendor/bundle/ruby/2.5.0/gems/airbrake-ruby-4.2.0/lib/airbrake-ruby.rb:103:in `configure'
/Users/username/project_name/project_name_xxxxxx/config/initializers/airbrake.rb:12:in `block in <top (required)>': undefined method `route_stats=' for #<Airbrake::Config:0x00007f87fc941048> (NoMethodError)

route_stats=undefined と言っているので、

# config/initializers/airbrake.rb

# frozen_string_literal: true

Airbrake.configure do |c|
  ...
  c.route_stats = true
end

c.route_stats = true を消して、

$ bundle exec rails s

本番環境ではまだ動作確認してない。

gem のアップデート方法があっているかは不明。

参考

airbrake のアップデート方法調べたけど見つけられなかった・・・

関連記事