boulder-food-rescue / food-rescue-robot

A Rails App for Managing "Just in Time" Food Rescue, Developed by/for Boulder Food Rescue in Boulder, CO, USA
49 stars 56 forks source link

Dependency incompatabilities when setting up the dev environment #184

Open phyninja opened 3 years ago

phyninja commented 3 years ago

Expected Behavior

Running bundle install installs all of the project's dependencies.

Actual Behavior

The following error message is produced:

Fetching https://github.com/thoughtbot/paperclip
Fetching https://github.com/rweng/jquery-datatables-rails.git
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies....................................................................................................................................................................
.........
Bundler could not find compatible versions for gem "actionmailer":
  In Gemfile:
    exception_notification-rake (~> 0.0.6) was resolved to 0.0.7, which depends on
      exception_notification (~> 3.0.1) was resolved to 3.0.1, which depends on
        actionmailer (>= 3.0.4)

    rails (~> 3.2.16) was resolved to 3.2.22.5, which depends on
      actionmailer (= 3.2.22.5)

Bundler could not find compatible versions for gem "actionpack":
  In Gemfile:
    twitter-bootstrap-rails was resolved to 3.2.2, which depends on
      less-rails (>= 2.5.0) was resolved to 4.0.0, which depends on
        actionpack (>= 4)

    rails (~> 3.2.16) was resolved to 3.2.22.5, which depends on
      actionpack (= 3.2.22.5)

Bundler could not find compatible versions for gem "activemodel":
  In Gemfile:
    rails (~> 3.2.16) was resolved to 3.2.22.5, which depends on
      activerecord (= 3.2.22.5) was resolved to 3.2.22.5, which depends on
        activemodel (= 3.2.22.5)

    paperclip was resolved to 4.3.1, which depends on
      activemodel (>= 3.2.0)

    simple_form was resolved to 2.1.3, which depends on
      activemodel (~> 3.0)

Bundler could not find compatible versions for gem "activerecord":
  In Gemfile:
    rails (~> 3.2.16) was resolved to 3.2.22.5, which depends on
      activerecord (= 3.2.22.5)

    rails-erd was resolved to 1.5.2, which depends on
      activerecord (>= 3.2)

    ranked-model was resolved to 0.4.1, which depends on
      activerecord (>= 3.1.12)

Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    paperclip was resolved to 4.3.1, which depends on
      activesupport (>= 3.2.0)

    rails (~> 3.2.16) was resolved to 3.2.22.5, which depends on
      activesupport (= 3.2.22.5)

    rspec-rails (~> 3.5) was resolved to 3.9.1, which depends on
      activesupport (>= 3.0)

Bundler could not find compatible versions for gem "capybara":
  In Gemfile:
    capybara

    capybara-screenshot was resolved to 1.0.25, which depends on
      capybara (>= 1.0, < 4)

    poltergeist (~> 1.12) was resolved to 1.18.1, which depends on
      capybara (>= 2.1, < 4)

Bundler could not find compatible versions for gem "jquery-rails":
  In Gemfile:
    jquery-rails (= 2.1.4)

    jquery-datatables-rails was resolved to 3.4.0, which depends on
      jquery-rails

Bundler could not find compatible versions for gem "json":
  In Gemfile:
    json

    rails (~> 3.2.16) was resolved to 3.2.22.5, which depends on
      railties (= 3.2.22.5) was resolved to 3.2.22.5, which depends on
        rdoc (~> 3.4) was resolved to 3.12.2, which depends on
          json (~> 1.4)

Bundler could not find compatible versions for gem "mimemagic":
  In Gemfile:
    paperclip was resolved to 4.3.1, which depends on
      mimemagic (= 0.3.0)

Could not find gem 'mimemagic (= 0.3.0)', which is required by gem 'paperclip', in any of the sources.

Bundler could not find compatible versions for gem "nokogiri":
  In Gemfile:
    poltergeist (~> 1.12) was resolved to 1.18.1, which depends on
      capybara (>= 2.1, < 4) was resolved to 2.18.0, which depends on
        nokogiri (>= 1.3.3)

    poltergeist (~> 1.12) was resolved to 1.18.1, which depends on
      capybara (>= 2.1, < 4) was resolved to 2.18.0, which depends on
        xpath (>= 2.0, < 4.0) was resolved to 3.2.0, which depends on
          nokogiri (~> 1.8)

Bundler could not find compatible versions for gem "prawn":
  In Gemfile:
    prawn (~> 2.1.0)

    prawn-table (~> 0.2.2) was resolved to 0.2.2, which depends on
      prawn (>= 1.3.0, < 3.0.0)

Bundler could not find compatible versions for gem "rack":
  In Gemfile:
    rails (~> 3.2.16) was resolved to 3.2.22.5, which depends on
      actionpack (= 3.2.22.5) was resolved to 3.2.22.5, which depends on
        rack (~> 1.4.5)

    better_errors was resolved to 2.9.1, which depends on
      rack (>= 0.9.0)

    poltergeist (~> 1.12) was resolved to 1.18.1, which depends on
      capybara (>= 2.1, < 4) was resolved to 2.18.0, which depends on
        rack (>= 1.0.0)

    rails (~> 3.2.16) was resolved to 3.2.22.5, which depends on
      actionpack (= 3.2.22.5) was resolved to 3.2.22.5, which depends on
        rack-cache (~> 1.2) was resolved to 1.12.1, which depends on
          rack (>= 0.4)

    rails (~> 3.2.16) was resolved to 3.2.22.5, which depends on
      actionpack (= 3.2.22.5) was resolved to 3.2.22.5, which depends on
        sprockets (~> 2.2.1) was resolved to 2.2.3, which depends on
          rack (~> 1.0)

    thin was resolved to 1.8.0, which depends on
      rack (>= 1, < 3)

Bundler could not find compatible versions for gem "rack-test":
  In Gemfile:
    rack-test

    poltergeist (~> 1.12) was resolved to 1.18.1, which depends on
      capybara (>= 2.1, < 4) was resolved to 2.18.0, which depends on
        rack-test (>= 0.5.4)

Bundler could not find compatible versions for gem "rails":
  In Gemfile:
    rails (~> 3.2.16)

    active_scaffold was resolved to 3.4.43, which depends on
      rails (>= 3.2.22.2, < 5)

    browser-timezone-rails was resolved to 1.1.0, which depends on
      rails (>= 3.1)

    yaml_db was resolved to 0.7.0, which depends on
      rails (>= 3.0)

Bundler could not find compatible versions for gem "railties":
  In Gemfile:
    devise (~> 3.2.0) was resolved to 3.2.4, which depends on
      railties (>= 3.2.6, < 5)

    dotenv-rails was resolved to 2.7.6, which depends on
      railties (>= 3.2)

    jquery-datatables-rails was resolved to 3.4.0, which depends on
      railties (>= 3.1)

    jquery-rails (= 2.1.4) was resolved to 2.1.4, which depends on
      railties (>= 3.0, < 5.0)

    rails (~> 3.2.16) was resolved to 3.2.22.5, which depends on
      railties (= 3.2.22.5)

    rspec-rails (~> 3.5) was resolved to 3.9.1, which depends on
      railties (>= 3.0)

    sass-rails (~> 3.2.6) was resolved to 3.2.6, which depends on
      railties (~> 3.2.0)

Bundler could not find compatible versions for gem "rb-fsevent":
  In Gemfile:
    rb-fsevent (~> 0.9.0)

    guard-rspec was resolved to 4.7.3, which depends on
      guard (~> 2.1) was resolved to 2.16.2, which depends on
        listen (>= 2.7, < 4.0) was resolved to 3.5.0, which depends on
          rb-fsevent (~> 0.10, >= 0.10.3)

Bundler could not find compatible versions for gem "ruby":
  In Gemfile:
    ruby (~> 2.3.7.0)

    capybara-screenshot was resolved to 1.0.25, which depends on
      launchy was resolved to 2.5.0, which depends on
        ruby (>= 2.4.0)

Bundler could not find compatible versions for gem "sass-rails":
  In Gemfile:
    sass-rails (~> 3.2.6)

    jquery-datatables-rails was resolved to 3.4.0, which depends on
      sass-rails

Steps to Recreate

Follow the instructions to set up the dev environment on OSX. After cding into the food-rescue-robot directory, run

gem install bundler -v 1.17.3
bundle install

Environment

Operating System: MacOS BigSur (11.2.3) Ruby version: 2.3.7 bundler version: 1.17.3

rylanb commented 3 years ago

Likely due to mimemagic fun from two weeks ago.

Try running bundle update mimemagic or pinning mimemagic to something ~ 0.3.10

phyninja commented 3 years ago

The Gemfile specifies the use of a particular revision of paperclip https://github.com/boulder-food-rescue/food-rescue-robot/blob/37c2dc6e58516b3e406beb4678cb871e9cf2dc7d/Gemfile#L71 which loops back to the mimemagic error:

Bundler could not find compatible versions for gem "mimemagic":
  In Gemfile:
    paperclip was resolved to 4.3.1, which depends on
      mimemagic (= 0.3.0)

Any reason we cannot also upgrade paperclip to the latest version (6.1.0)?

rylanb commented 3 years ago

That is two major version bumps of paperclip, you'd have to check the release notes, but likely breaking changes on each version bump. https://github.com/thoughtbot/paperclip/blob/master/NEWS

I don't know if we can just upgrade it that far

phyninja commented 3 years ago

I tried 'pinning mimemagic' to 0.3.10 in the following way:

Then, in food-rescue-robot's Gemfile, I specified the fork and the newly-created-ref in place of the existing info in lines 71 and 72:

gem 'paperclip', git: 'https://github.com/thoughtbot/paperclip',
                 ref: '523bd46c768226893f23889079a7aa9c73b57d68'

and ran

bundle install

only to find that I'm now facing a new error. Because I'm not seeing that paperclip or mimemagic is installed, I will need some more time to confirm whether or not your suggestion works.

rylanb commented 3 years ago

Yup, we're in a pretty rough spot w/ this app around that right now.

Paperclip v5.0.0 has a note: * Drop support for end-of-life'd Rails 3.2 and 4.1

So we literally cannot upgrade this app right now.

I believe there is a new version coming by end of the year that will be better around this.

dylnclrk commented 1 year ago

For any folks trying to get the app running in the future, I was able to get it running with a few tweaks and removing attachment features. Sharing here as it might be a good starting point for you. Sorry these notes are rough, I tried to simplify things, but I'm sure it can be streamlined further.