Search code examples
ruby-on-railsrubyrubygemsruby-on-rails-5bundler

Rails 5 with Adhoq gem. Unable to resolve bundler dependencies


OK, so I am trying to install the Adhoq gem into my Rails 5 project.

When I add it like usual (gem 'adhoq') it fails as the default dependencies are for rails 4 with a few other outdated libraries of which I have more recent versions.

I can see gemfiles/Gemfile-rails-5.0x exists but I have never seen this design pattern before.

I know I could fork it and manually update the dependencies but that presents a whole host of other issues and since this gemfile exists it leads me to something I currently don't know about Bundler or gems as a whole.

A glance at the Bundler docs wasn't helpful, but I will keep digging.

What is it that I am missing?


Solution

  • Do this:

    1. Add gem 'adhoq', '0.1.2' into Gemfile. (0.1.2 is latest)
    2. before bundle install check the dependencies of other gems with adhoq. To check runtime dependencies please refer this website. https://rubygems.org/gems/adhoq.
    3. Execute bundle install. You will not receive any errors if all runtime dependencies satisfied for the adhoq gem.
    4. Still If you are not able to execute bundle install than Remove Gemfile.lock. and once again execute bundle install. Hope this will work.

    Note: To avoid step 4 you can update particular gem one by one to satisfied runtime dependencies.

    Cheers