Closed matiasgarcia closed 3 years ago
The versions in your Appraisal file don't do what you think they do.
gem "activesupport", '~> 5.0', '>= 5.0.0'
~> 5.0
means >= 5.0 and < 6
>= 5.0.0
means 5.0.0 or higher (Rails 6 included).
It's going to install the highest version of the gem that matches all of your criteria (both '~> 5.0'
and '>= 5.0.0'
), which is going to be the biggest version of 5 that's less than 6, which is 5.2.4.4.
Something I think you should know is:
~> 5.0.0
means >= 5.0.0 and < 5.1
Likewise, ~> 5.0.3
means >= 5.0.3 and < 5.1
I think what you really want is:
appraise "rails-5.0" do
gem "activesupport", '~> 5.0.0'
gem "activemodel", '~> 5.0.0'
gem "activerecord", '~> 5.0.0'
end
appraise "rails-5.1" do
gem "activesupport", '~> 5.1.0'
gem "activemodel", '~> 5.1.0'
gem "activerecord", '~> 5.1.0'
end
This should install 5.0.7.2 in the rails-5.0
appraisal, and 5.1.7 in the rails-5.1
appraisal.
Thanks @natematykiewicz
I have the following gemspec:
And the Appraisals file:
Gemfile is configured as the following:
I added a test to see if it's using the proper version:
However in both runs I get:
I read in the README.md that it seems that things like
rbenv
won't work nice with Appraisal, so I decided to test this on CircleCI since we are using that as our CI.I am using the following
circle.yml
:Still, in both runs I get the same output:
What am I doing wrong?