Failed run db:migrate when upgrading to 2.4.0 in docker


#1

I am upgrading mastodon from v2.3.3 to v2.4.0 in docker. I success run ‘docker-compose build’, when I run ‘docker-compose run --rm web rake db:migrate’, I get these errors.

Starting mastodon_db_1 ... 
Starting mastodon_db_1 ... done
Starting mastodon_es_1 ... done
rake aborted!
LoadError: cannot load such file -- aws-sdk
/mastodon/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/mastodon/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
/mastodon/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
/mastodon/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
/mastodon/config/initializers/paperclip_20180310backup.rb:17:in `<top (required)>'
/mastodon/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
/mastodon/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
/mastodon/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:277:in `block in load'
/mastodon/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
/mastodon/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:277:in `load'
/mastodon/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/engine.rb:657:in `block in load_config_initializer'
/mastodon/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/notifications.rb:170:in `instrument'
/mastodon/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/engine.rb:656:in `load_config_initializer'
/mastodon/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/engine.rb:614:in `block (2 levels) in <class:Engine>'
/mastodon/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/engine.rb:613:in `each'
/mastodon/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/engine.rb:613:in `block in <class:Engine>'
/mastodon/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `instance_exec'
/mastodon/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `run'
/mastodon/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:61:in `block in run_initializers'
/mastodon/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:50:in `each'
/mastodon/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:50:in `tsort_each_child'
/mastodon/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:60:in `run_initializers'
/mastodon/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/application.rb:361:in `initialize!'
/mastodon/config/environment.rb:5:in `<top (required)>'
/mastodon/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/mastodon/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/mastodon/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/mastodon/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/mastodon/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/mastodon/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
/mastodon/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
/mastodon/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
/mastodon/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/application.rb:337:in `require_environment!'
/mastodon/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/mastodon/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)

Can anyone help me solve this problem?


#2

I don’t know about Docker, but I’d run gem install somewhere in between.


#3

I don’t know when and where to run ‘gem install’ in docker…


#4

Still meet this problem. Any new idea?


#5

I’m really NOT sure, but something like this ?
docker-compose run --rm web gem install