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.
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 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.configblock in a
Rails.application.config.after_initializeblock, like so:
Spree.config do |config|
# config settings initialized here
If you don't perform this update to the code, you may expect to get the following error:
uninitialized constant Spree::Preference (NameError)
For example, if you use
spree_auth_devise, you'll need to update
config/initializers/devise.rband wrap the configuration in
Spree::Auth::Config.signout_after_password_change = false
gem 'spree', '>= 4.5.0'
Update all other spree gems used in your application to 4.5.0 or version compatible with 4.5:
gem 'spree_sample', '~> 4.5.0'
gem 'spree_emails', '~> 4.5.0'
gem 'spree_frontend', '>= 4.5.0'
gem 'spree_backend', '>= 4.5.0'
gem 'spree_gateway', '~> 3.10'
gem 'spree_auth_devise', '>= 4.5.0'
gem 'spree_i18n', '~> 5.1'
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:
bin/rails g spree:frontend:install
And that's a wrap!