brew upgrade ruby-install
ruby-install ruby 2.6.5
Depending on ruby version manager (rvm/chruby/rbenv) you may need to change directories or select ruby 2.6.5 then
gem install bundler 2.1.4
cd connect_backend
bundle install
Bundler is one of the best tools in the ruby world.
Since the whole 2.0 update it has however become a bit of a pain. We now have to make sure we're on the exact same patch level of bundler EVERYWHERE or face ongoing issues.
What this means is that for every bundler bump we have to update it in:
- ebconfig files for aws
- docker files
- did you know we have two of these for backend?
- every dev machine :-/
- circle-ci scripts
- jenkins if we're using it there too (haven't got that far but worried about rake tasks)
I've now locked bundler in the Gemfile. I don't know if this is the right move; so feel free to reconsider this a few months later. I'm hoping it helps to prevent random bumps.
types:
- style changes - optional but rubocop might yell
- syntax changes - required to parse (only 1 so far)
- removals/replacements
level: style (rubocop)
required.map do |param|
- begin
param_values << params.require(param)
- rescue ActionController::ParameterMissing => exception
+ rescue ActionController::ParameterMissing => exception
errors << exception.message
- end
level: syntax error
- before_action only: [:sync_blm_booklist, :import_sections_from_compete, :send_welcome_emails] { ensure_catalog_authorized!(param_key: :catalog_id) }
+ before_action(only: [:sync_blm_booklist, :import_sections_from_compete, :send_welcome_emails]) { ensure_catalog_authorized!(param_key: :catalog_id) }
level: style - likely optimization
When declaring a regex comparison call the comparison against the existing regex. Avoids converting string to regex.
- if params[:run_charges] =~ /RUN ALL CHARGES/
+ if /RUN ALL CHARGES/.match?(params[:run_charges])
- unless recipient_email =~ /.+@.+\..+/
+ unless /.+@.+\..+/.match?(recipient_email)
level: removal/replacement
Prior to 2.6 you could get the row-index of the current csv using $.
. This was good for reporting row-errors. The docs for 2.6 & 2.7 still show this but at a minimum it no longer works for CSVs.
Using .with_index
on the iterator is a fairly easy alternative.
- CSV.foreach(@csv_path) do |row_data|
+ CSV.foreach(@csv_path).with_index(1) do |row_data, row_number|
row = Row.new(row_data, catalog_id: @catalog.id)
row_result = row.find_license_or_error
if row_result.key? :errors
- add_row_numbers(row_result[:errors], $.) # $. is the File backed line number
+ add_row_numbers(row_result[:errors], row_number)
level: style
- expect(response_json['error']['exception']).to eq("bad URI(is not URI?): ://")
+ expect(response_json['error']['exception']).to eq("bad URI(is not URI?): \"://\"")
There's absolutely no way to do this from the AWS webUI. Two options then:
- build a new environment in the webUI, carefully copying all settings over
- use the command-line tool to "upgrade" an existing environment
updating the environment:
aws --region us-east-1 elasticbeanstalk update-environment --solution-stack-name "64bit Amazon Linux 2018.03 v2.11.2 running Ruby 2.6 (Passenger Standalone)" --environment-name [REPLACE WITH NAME]
Awesome notes, thank you @tgaff! 🍻