CitizenLabDotCo / citizenlab-oss

Go Vocal is a digital democracy platform that facilitates community participation and co-creation. This is the open source version of our product.
GNU Affero General Public License v3.0
40 stars 8 forks source link

Unable to deploy due to version mismatch in rake #47

Closed willcohen closed 3 months ago

willcohen commented 1 year ago

Using the instructions at https://developers.citizenlab.co/start-dev-environment/, the process currently fails on the docker-compose run web rake db:create with the following error. Changing the version of rake in the Gemfile.lock to 13.0.1 instead of 13.0.6 allows installation to proceed.

...
Using spring-watcher-listen 2.0.1
Using surveys 0.1.0 from source at `engines/free/surveys`
Using test-prof 1.0.8
Using user_confirmation 0.1.0 from source at `engines/free/user_confirmation`
Using vcr 6.1.0
Using volunteering 0.1.0 from source at `engines/free/volunteering`
Using webmock 3.14.0
Using whenever 1.0.0
Bundle complete! 108 Gemfile dependencies, 284 gems now installed.
Bundled gems are installed into `/bundle`
1 installed gem you directly depend on is looking for funding.
  Run `bundle fund` for details
rake aborted!
Gem::LoadError: You have already activated rake 13.0.1, but your Gemfile requires rake 13.0.6. Prepending `bundle exec` to your command may solve this.
/usr/local/bundle/gems/bundler-2.3.20/lib/bundler/runtime.rb:308:in `check_for_activated_spec!'
/usr/local/bundle/gems/bundler-2.3.20/lib/bundler/runtime.rb:25:in `block in setup'
/usr/local/bundle/gems/bundler-2.3.20/lib/bundler/spec_set.rb:135:in `each'
/usr/local/bundle/gems/bundler-2.3.20/lib/bundler/spec_set.rb:135:in `each'
/usr/local/bundle/gems/bundler-2.3.20/lib/bundler/runtime.rb:24:in `map'
/usr/local/bundle/gems/bundler-2.3.20/lib/bundler/runtime.rb:24:in `setup'
/usr/local/bundle/gems/bundler-2.3.20/lib/bundler.rb:163:in `setup'
/usr/local/bundle/gems/bundler-2.3.20/lib/bundler/setup.rb:10:in `block in <top (required)>'
/usr/local/bundle/gems/bundler-2.3.20/lib/bundler/ui/shell.rb:136:in `with_level'
/usr/local/bundle/gems/bundler-2.3.20/lib/bundler/ui/shell.rb:88:in `silence'
/usr/local/bundle/gems/bundler-2.3.20/lib/bundler/setup.rb:10:in `<top (required)>'
/cl2_back/config/boot.rb:21:in `<top (required)>'
/cl2_back/config/application.rb:3:in `require_relative'
/cl2_back/config/application.rb:3:in `<top (required)>'
/cl2_back/Rakefile:6:in `require_relative'
/cl2_back/Rakefile:6:in `<top (required)>'
(See full trace by running task with --trace)
ERROR: 1

Unfortunately, after this change, the following db:reset tasks fails as well, with

...
2023-06-26 18:50:41.057995 D [8:7700] ActiveRecord::Base --   CustomFieldOption Update All (0.5ms)  UPDATE "custom_field_options" SET "ordering" = ("custom_field_options"."ordering" + 1), "updated_at" = '2023-06-26 18:50:41.057036' WHERE "custom_field_options"."custom_field_id" = $1 AND ("custom_field_options"."ordering" >= 6)  [["custom_field_id", "7b18aa83-6208-47d7-ad03-83f89d180a41"]]
2023-06-26 18:50:41.062284 D [8:7700] ActiveRecord::Base --   CustomFieldOption Create (1.2ms)  INSERT INTO "custom_field_options" ("custom_field_id", "key", "title_multiloc", "ordering", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"  [["custom_field_id", "7b18aa83-6208-47d7-ad03-83f89d180a41"], ["key", "8"], ["title_multiloc", "{\"en\":\"Doctoral or equivalent\",\"ar-MA\":\"شهادة الدكتوراه أو ما يعادلها\",\"ar-SA\":\"شهادة الدكتوراه أو ما يعادلها\",\"ca-ES\":\"Doctoral or equivalent\",\"da-DK\":\"Ph.d. eller tilsvarende\",\"de-DE\":\"Doktortitel oder gleichwertiger Abschluss\",\"el-GR\":\"Doctoral or equivalent\",\"en-CA\":\"Doctoral or equivalent\",\"en-GB\":\"Doctoral or equivalent\",\"es-CL\":\"Doctorado\",\"es-ES\":\"Doctorado\",\"fr-BE\":\"Doctorat ou équivalent\",\"fr-FR\":\"Doctorat ou équivalent\",\"hr-HR\":\"Doktor znanosti ili ekvivalentno\",\"hu-HU\":\"Doctoral or equivalent\",\"it-IT\":\"Dottorato o equivalente\",\"kl-GL\":\"Ph.d. imaluunniit assingusoq\",\"lb-LU\":\"Doktorgrad oder entspriechend\",\"lv-LV\":\"Doktora grāds vai līdzvērtīgs grāds\",\"mi\":\"Doctoral or equivalent\",\"nb-NO\":\"Doktorgrad  eller tilsvarende\",\"nl-BE\":\"Doctoraat of gelijkwaardig\",\"nl-NL\":\"Doctoraat of gelijkwaardig\",\"pl-PL\":\"Doktoranckie lub ich odpowiednik\",\"pt-BR\":\"Doutorado ou equivalente\",\"ro-RO\":\"Doctorat sau echivalent\",\"sr-Latn\":\"Doktor nauka\",\"sr-SP\":\"Доктор наука\",\"sv-SE\":\"Doktorsexamen eller motsvarande\",\"tr-TR\":\"Doktora veya eşdeğeri\"}"], ["ordering", 6], ["created_at", "2023-06-26 18:50:41.050929"], ["updated_at", "2023-06-26 18:50:41.050929"]]
2023-06-26 18:50:41.066890 D [8:7700] ActiveRecord::Base --   TRANSACTION (1.1ms)  COMMIT
rake aborted!
NoMethodError: undefined method `closed?' for nil:NilClass
/bundle/ruby/2.7.0/bundler/gems/carrierwave-a3ffc5381e70/lib/carrierwave/downloader/remote_file.rb:11:in `initialize'
/bundle/ruby/2.7.0/bundler/gems/carrierwave-a3ffc5381e70/lib/carrierwave/downloader/base.rb:48:in `new'
/bundle/ruby/2.7.0/bundler/gems/carrierwave-a3ffc5381e70/lib/carrierwave/downloader/base.rb:48:in `download'
/bundle/ruby/2.7.0/bundler/gems/carrierwave-a3ffc5381e70/lib/carrierwave/uploader/download.rb:19:in `download!'
/bundle/ruby/2.7.0/bundler/gems/carrierwave-a3ffc5381e70/lib/carrierwave/mounter.rb:98:in `block (2 levels) in remote_urls='
/bundle/ruby/2.7.0/bundler/gems/carrierwave-a3ffc5381e70/lib/carrierwave/mounter.rb:176:in `handle_error'
/bundle/ruby/2.7.0/bundler/gems/carrierwave-a3ffc5381e70/lib/carrierwave/mounter.rb:96:in `block in remote_urls='
/bundle/ruby/2.7.0/bundler/gems/carrierwave-a3ffc5381e70/lib/carrierwave/mounter.rb:95:in `zip'
/bundle/ruby/2.7.0/bundler/gems/carrierwave-a3ffc5381e70/lib/carrierwave/mounter.rb:95:in `remote_urls='
/bundle/ruby/2.7.0/bundler/gems/carrierwave-a3ffc5381e70/lib/carrierwave/mount.rb:166:in `remote_image_url='
/bundle/ruby/2.7.0/bundler/gems/carrierwave-a3ffc5381e70/lib/carrierwave/orm/activerecord.rb:21:in `remote_image_url='
/bundle/ruby/2.7.0/gems/activemodel-6.1.7.3/lib/active_model/attribute_assignment.rb:49:in `public_send'
/bundle/ruby/2.7.0/gems/activemodel-6.1.7.3/lib/active_model/attribute_assignment.rb:49:in `_assign_attribute'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/attribute_assignment.rb:21:in `block in _assign_attributes'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/attribute_assignment.rb:13:in `each'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/attribute_assignment.rb:13:in `_assign_attributes'
/bundle/ruby/2.7.0/gems/activemodel-6.1.7.3/lib/active_model/attribute_assignment.rb:34:in `assign_attributes'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/core.rb:525:in `initialize'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/inheritance.rb:72:in `new'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/inheritance.rb:72:in `new'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/reflection.rb:157:in `build_association'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/associations/association.rb:321:in `build_record'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/associations/collection_association.rb:109:in `build'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/associations/collection_proxy.rb:317:in `build'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/nested_attributes.rb:501:in `block in assign_nested_attributes_for_collection_association'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/nested_attributes.rb:493:in `each'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/nested_attributes.rb:493:in `assign_nested_attributes_for_collection_association'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/nested_attributes.rb:371:in `text_images_attributes='
/bundle/ruby/2.7.0/gems/activemodel-6.1.7.3/lib/active_model/attribute_assignment.rb:49:in `public_send'
/bundle/ruby/2.7.0/gems/activemodel-6.1.7.3/lib/active_model/attribute_assignment.rb:49:in `_assign_attribute'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/attribute_assignment.rb:21:in `block in _assign_attributes'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/attribute_assignment.rb:13:in `each'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/attribute_assignment.rb:13:in `_assign_attributes'
/bundle/ruby/2.7.0/gems/activemodel-6.1.7.3/lib/active_model/attribute_assignment.rb:34:in `assign_attributes'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/core.rb:525:in `initialize'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/inheritance.rb:72:in `new'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/inheritance.rb:72:in `new'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/persistence.rb:54:in `create!'
/cl2_back/db/seeds.rb:605:in `block in <main>'
/cl2_back/db/seeds.rb:602:in `each'
/cl2_back/db/seeds.rb:602:in `<main>'
/bundle/ruby/2.7.0/gems/railties-6.1.7.3/lib/rails/engine.rb:566:in `load'
/bundle/ruby/2.7.0/gems/railties-6.1.7.3/lib/rails/engine.rb:566:in `block in load_seed'
/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/execution_wrapper.rb:91:in `wrap'
/bundle/ruby/2.7.0/gems/railties-6.1.7.3/lib/rails/engine.rb:640:in `block (2 levels) in <class:Engine>'
/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/callbacks.rb:126:in `instance_exec'
/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
/bundle/ruby/2.7.0/gems/activesupport-6.1.7.3/lib/active_support/callbacks.rb:137:in `run_callbacks'
/bundle/ruby/2.7.0/gems/railties-6.1.7.3/lib/rails/engine.rb:566:in `load_seed'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:450:in `load_seed'
/bundle/ruby/2.7.0/gems/activerecord-6.1.7.3/lib/active_record/railties/databases.rake:392:in `block (2 levels) in <main>'
/bundle/ruby/2.7.0/gems/sentry-ruby-5.9.0/lib/sentry/rake.rb:24:in `execute'
Tasks: TOP => db:reset => db:setup => db:seed
(See full trace by running task with --trace)
ERROR: 1
willcohen commented 3 months ago

Solved by prepending with bundle exec -- sorry for the bother.