4.4 to 4.5
This guide covers upgrading a 4.4 Spree application to Spree 4.5.
If you're on an older version than 4.4 please follow previous upgrade guides and perform those upgrades incrementally, eg.
This is the safest and recommended method.
Upgrade Rails
Rails 6.0 is no longer supported - if you haven’t already, you’ll need to upgrade to Rails 6.1 or 7.0. The effort to upgrade to Rails 6.1 is relatively low, but brings a lot of improvements around ActiveStorage and handling of CDNs. See the Rails docs for upgrading from 6.0 to 6.1, and for upgrading from 6.1 to 7.0.
If using Rails 7, you will need to install libvips on your cloud environment, as Rails 7 uses vips as its default variant processor. You can still use imagemagick, but you’ll need to manually set it in your Rails config.
Update Spree Config
If you're upgrading your app to Rails 7, you'll need to make a slight update to your spree config initializer. In config/initializers/spree.rb
, wrap the Spree.config
block in a Rails.application.config.after_initialize
block, like so:
If you don't perform this update to the code, you may expect to get the following error:
Update other initializers
Just like with Spree::Config, you may need to update other intializers in your application, that use autoloadable constants.
For example, if you use spree_auth_devise
, you'll need to update config/initializers/devise.rb
and wrap the configuration in Rails.application.config.after_initialize
block:
Update Gemfile
Update all other spree gems used in your application to 4.5.0 or version compatible with 4.5:
If your application depends on the Spree v1 API, you'll have to include it as a gem, as it has been extracted from the spree gem:
Update gems
Install missing migrations
Run migrations
Run Additional Commands for Frontend
If using Spree Frontend, run the following additional commands to get everything set up correctly with the updated gems:
And that's a wrap! 🎉
Read the release notes
For information about changes contained within this release, please read the Spree 4.5.0 Release Notes.
More info
If you have any questions, issues or suggestions feel free to reach out through Spree slack channels.
Last updated