Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency incompatabilities when setting up the dev environment #184

Open
phyninja opened this issue Apr 15, 2021 · 6 comments
Open

Dependency incompatabilities when setting up the dev environment #184

phyninja opened this issue Apr 15, 2021 · 6 comments

Comments

@phyninja
Copy link

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
Copy link
Collaborator

rylanb commented Apr 15, 2021

Likely due to mimemagic fun from two weeks ago.

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

@phyninja
Copy link
Author

The Gemfile specifies the use of a particular revision of paperclip

ref: '523bd46c768226893f23889079a7aa9c73b57d68'

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
Copy link
Collaborator

rylanb commented Apr 15, 2021

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
Copy link
Author

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
Copy link
Collaborator

rylanb commented Apr 17, 2021

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
Copy link

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.

  • First off, I ran the app on an Intel Mac. I could not get Ruby 2.7 running on an M1 Mac without following some complex workarounds.
  • Make sure you have the right version of bundler: gem install bundler -v ‘~> 1.17.3’. I had to uninstall newer versions w/ gem uninstall bundler in order to get it working.
  • Now I started running bundle install and fixing the issues that arose as they came up.
  • The first issue I encountered was with installing mimemagic, which has been yanked from the package registry. Unfortunately, the only workaround for me was to remove paperclip and the associated features.
    • Turn off the attachment features in the Region and Volunteer models (Remove calls to has_attached_file and validates_attachment_file_name)
    • Remove paperclip from the Gemfile.
  • Next I ran in to some issues with therubyracer and libv8.
    • Install v8 3.15: brew install v8@3.15
    • bundle config build.libv8 --with-system-v8
    • bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
  • Next I ran in to an issue compiling native extensions for our web server thin,
    • Ignore the errors: bundle config build.thin --with-cflags="-Wno-error=implicit-function-declaration"
  • Finally, pg would not compile native extensions. Possibly because my version of Postgres was too new.
    • To fix, I installed Postgres 10: brew install postgresql@10
    • Follow the post-install instructions to set up your path.
    • Make sure v10 can start, and is running.
    • I was still running in to problems installing pg 0.18, and needed to update pg to version 0.21.0: bundle update pg
    • (Optional?) brew install libpq I'm not sure if this was necessary, but I installed and followed the post-install directions.
  • At this point I could install all the dependencies, and start the app. But bin/setup was failing in the bin/support/bootstrap-database.rb task. So I ran through the db steps manually: createuser -s -U bfr_webapp_db (I made this a superuser, but could probably have just made them an owner), createdb bfr_webapp_db.
  • Finally, I ran bundle exec rake db:schema:load (I didn't want to mess with trying to run migrations, since I would have to first remove the paperclip-related migration code) and bundle exec rake db:sample_region to seed some test data before starting the app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants