AGéoCoder
AGéoCoder

Reputation: 922

Spree Commerce Setup Error: "Unknown Version...(Runtime Error)"

I am going through the open-source Spree commerce tutorial. I am new to Ruby, so I just installed Ruby 2.7.2 and Rails 6.1. Unfortunately, Spree doesn't support Rails 6.1 yet, as described here: Bundler could not find compatible versions for gem “rails”.... So, I followed the solutions provided on that SO post and modified my Gemfile to set rails (and railties) to 6.0.3. That seemed to fix the error mentioned on that SO post...

But now when trying to run the command from the tutorial "bundle exec rails g spree:install --user_class=Spree::User", I'm getting the error:

C:/Program Files/Ruby27-x64/lib/ruby/gems/2.7.0/gems/railties-6.0.3/lib/rails/application/configuration.rb:156:in `load_defaults': Unknown version "6.1" (RuntimeError)

Why is this happening, and how do I resolve this error?

Thank you in advance!

Upvotes: 1

Views: 1314

Answers (1)

dPak
dPak

Reputation: 86

Get to the config/application.rb file in your app's folder and set the line with

config.load_defaults 6.1

to the below

config.load_defaults 6.0

The problem is, when you initially ran rails new command, the generators set the rails version to 6.1, which doesn't change when you specified 6.0.0 as version in Gemfile.

Upvotes: 7

Related Questions