thoughtbot / appraisal

A Ruby library for testing your library against different versions of dependencies.
https://thoughtbot.com
MIT License
1.25k stars 107 forks source link

Dependencies not in the API or the lockfile #136

Closed sudoremo closed 4 years ago

sudoremo commented 6 years ago

Hi folks

First of all, many thanks for your wonderful Gem! Unfortunately I can not get this to work quite yet ā€“ when running bundle exec appraisal install, I'm getting the following exception:

bundle exec appraisal install
Note: Run `appraisal generate --travis` to generate Travis CI configuration.
>> bundle check --gemfile='/Users/.../work/gems/workhorse/gemfiles/rails_3.gemfile' || bundle install --gemfile='/Users/.../work/gems/workhorse/gemfiles/rails_3.gemfile' --retry 1
Bundler can't satisfy your Gemfile's dependencies.
Install missing gems with `bundle install`.
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies....
Using rake 12.3.0
Fetching activerecord 3.2.14
Downloading activerecord-3.2.14 revealed dependencies not in the API or the lockfile (activesupport (= 3.2.14), activemodel (= 3.2.14), arel (~> 3.0.2), tzinfo (~> 0.3.29)).
Either installing with `--full-index` or running `bundle update activerecord` should fix the problem.

In rails_3.gemfile:
  workhorse was resolved to 0.3.0, which depends on
    activerecord

The respective code can be found under https://github.com/sitrox/workhorse/tree/appraisal. What have I done wrong? Thanks for any help :)

nickcharlton commented 6 years ago

Hello! Thanks for providing the example project, it's a huge help to replicating issues like this.

I couldn't see that you'd done anything wrong at all, but I had a hunch that it might be because Rails 3 is so old now. That looks like the case.

I modified my installed version of appraisal to pass through the full-index (see the bundle install docs) argument to bundle install and it can then bundle successfully.

I've opened #137 which gives us a quick solution to this, so you might wish to give it a spin and see how you get on!

sudoremo commented 6 years ago

Wow, many thanks for your great support and the quick fix - just remarkable! Iā€˜m back in the office early next week and will definitely give this a spin then šŸ‘

sudoremo commented 6 years ago

Thanks a lot @nickcharlton, this step now worked thanks to your PR. However, as the old versions of rails require older versions of ruby: Is there a way of getting appraisal to work with different, fixed combinations of Gemfiles with ruby versions? I've tried this in the current appraisal branch of our Gem but could not get it to work yet. Thanks for any help!

nickcharlton commented 6 years ago

Basically, no, but I think it's something that would be cool to do.

In administrate, I've been working with a complex(ish) Circle CI configuration that does test with multiple Rubies (much like Travis supports build matrices).

This is probably something best discussed in a new issue, but I'd be concerned about coming up with something which was quite CI/environment specific. But it could definitely be done.

nickcharlton commented 4 years ago

I'm going to close this as it's not had a response for a while. Please reopen this issue if it's an issue you're still having!